Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > sizeof(x)
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 13 Topic 25205 of 27671
Post > Topic >>

sizeof(x)

by Ioannis Vranos <ivranos@[EMAIL PROTECTED] > Mar 30, 2008 at 10:50 PM

In C99 it is mentioned:

"The sizeof operator yields the size (in bytes) of its operand, which
may be an expression or the parenthesized name of a type.".


If I am not wrong, this implies that

int x;

size_t y= sizeof(x);


is not valid.


and only the following is valid:


int x;

size_t y= sizeof x;


However I am puzzled, and thought the first was also valid in
C90/C95(/C++03).
 




 13 Posts in Topic:
sizeof(x)
Ioannis Vranos <ivrano  2008-03-30 22:50:00 
Re: sizeof(x)
Harald van =?UTF-8?b?RMSz  2008-03-30 22:04:00 
Re: sizeof(x)
Ioannis Vranos <ivrano  2008-03-30 23:07:05 
Re: sizeof(x)
Ioannis Vranos <ivrano  2008-03-30 23:08:39 
Re: sizeof(x)
Ian Collins <ian-news@  2008-03-31 09:10:25 
Re: sizeof(x)
Ioannis Vranos <ivrano  2008-03-30 23:11:55 
Re: sizeof(x)
Eric Sosman <esosman@[  2008-03-30 17:21:19 
Re: sizeof(x)
Ioannis Vranos <ivrano  2008-03-31 00:22:19 
Re: sizeof(x)
Keith Thompson <kst-u@  2008-03-30 14:30:47 
Re: sizeof(x)
richard@[EMAIL PROTECTED]  2008-03-31 22:39:55 
Re: sizeof(x)
Kaz Kylheku <kkylheku@  2008-03-30 16:17:12 
Re: sizeof(x)
Harald van =?UTF-8?b?RMSz  2008-03-30 22:13:14 
Re: sizeof(x)
Harald van =?UTF-8?b?RMSz  2008-03-30 22:15:42 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 8:24:43 CDT 2008.