C Programming Reference >> C Basic Tutorials >> C Keywords Home >> sizeofui 30/12/06 - Views - Ratings : This keyword is used to calculate sizeof variable and standard data types. The object whose size has to be calculated is put into brackets following operator. Sizeof is used to make code more portable. Sizeof returns value of type size_t which is defined as another name of unsigned int and is capable of storing largest object size possible. Sizeof is also used in dynamic memory allocation. Code - void function ( void)
{
printf ("Int has size on this system %d bytes", sizeof (int));
}
|