sizeof???

Started by
21 comments, last by BattleGuard 20 years, 10 months ago
So all these strange types are really just renamed built-in types?

quote:Original post by Sneftel
How appropriate. You fight like a cow.


Look behind you! a three-headed monkey!!




You fight like a dairy farmer.

--{You fight like a dairy farmer!}

Advertisement
quote:Original post by Greatwolf
So all these strange types are really just renamed built-in types?

Sometimes. Not always. Not enough for you to count on it. some types like _int32 obviously are. Others, like wchar_t, aren''t.

In general, you should never expect types like size_t to act like any particular other type. Always use explicit casts in the (hopefully rare) situations where you need to convert to/from ints.


quote:Look behind you! a three-headed monkey!!

I''m not going to fall for that trick again!
The sizeof() function returns the size of a data type or variable in units of bytes. Let''s say we have...

int aInt;

Then you would use sizeof() as follows

sizeof(int);

should return the same as

sizeof aInt;

To determine the size of a type, enclose it in brackets. For a variable, omit the brackets.

Beginners and experts will find answers here.

This topic is closed to new replies.

Advertisement