M
magicman
thx
magicman said:What is the difference between: int a (*daytab)[13] and int a
*daytab[13]
thx
santosh said:magicman said:What is the difference between: int a (*daytab)[13] and int a
*daytab[13]
thx
In a declaration the first one declares daytab as a pointer to an array
of 13 ints. The second declares daytab as an array of 13 int*.
For the first one
daytab[n]
will be of type int
and for the second one
daytab[n]
will be of type int*.
Ben said:santosh said:magicman said:What is the difference between: int a (*daytab)[13] and int a
*daytab[13]
thx
In a declaration the first one declares daytab as a pointer to an
array of 13 ints. The second declares daytab as an array of 13 int*.
I guess you are ignoring the "a" in both!
For the first one
daytab[n]
will be of type int
It will be of type "array of 13 int". It will be converted to an int
pointer in most contexts hence, I suspect, the confusion.
and for the second one
daytab[n]
will be of type int*.
Yes, in both cases daytab[n] could be further subscripted or passed to
function that expects and int *.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.