Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[SOLVED] int *a and int (*a)

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
topaz
Posts: 17
Joined: 2014-10-09 12:49

[SOLVED] int *a and int (*a)

#1 Post by topaz »

Hello everyone,

I could not find a proper answer to my question, so here I am.
Could someone explain me the difference between "int *a" and "int (*a)" in c ?

I now that "int *a" is an array (integer pointer) but then,
what is "int (*a)" ?

If someone could help me, I would be very glad,
Thanks for helping me.
Last edited by topaz on 2015-02-26 22:17, edited 1 time in total.

User avatar
alansmithee
Posts: 41
Joined: 2013-02-02 08:02

Re: int *a and int (*a)

#2 Post by alansmithee »

Those two statements are the same thing, the latter form is just more explicit. The parentheses are unnecessary because they group things using the default grouping rules.

Similar to the way "2 + (3 * 4)" is the same as "2 + 3 * 4".
'alansmithee' is the user formerly known as 'saulgoode'.

topaz
Posts: 17
Joined: 2014-10-09 12:49

Re: int *a and int (*a)

#3 Post by topaz »

Thanks for the reply ^^

Post Reply