operand of postfix operator->

R

Rajesh S R

Consider the following code
int main()
{
struct name
{
long a;
int b;
long c;
}s={3,4,5},*p;
p=&s;

printf("%d",*(int *)((char *)p+(unsigned int)&(((struct name*)0)-
}



(unsigned int)&(((struct name*)0)->b)

Is the above expression valid according to C99?
That is, Can we have a null pointer as an operand of postfix operator-

Thanks in advance for the reply.
 

Ask a Question

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.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top