Archive

Archive for the ‘c language operators’ Category

sizeof()

July 27th, 2010 c# No comments

This operator accepts one parameter, which can be either a type or a variable itself and returns the size in bytes of that type or object:

a = sizeof (char);

This will assign the value 1 to a because char is a one-byte long type.
The value returned by sizeof is a constant, so it is always determined before program execution.

Categories: c language operators Tags: