//This program demonstrates how sizeof() function works //It returns the size of a particular type //We use format specifier %lu because sizeof() returns an unsigned long int // Malloc returns a pointer to the memory address that you have allocated // input to malloc is the number of bytes... #include int main (void) { int array[10] = {0}; //Example of using the sizeof() function printf("The size of an int is: %d bytes\n", sizeof(int)); printf("The size of an array of ints (array[10]) is: %lu bytes\n", sizeof(array)); printf("The size of 10 ints is: %lu bytes\n", 10 * sizeof(int)); printf("The size of a double is: %lu bytes\n", sizeof(double)); printf("The size of a char is: %lu bytes\n", sizeof(char)); printf("etc\n"); return 0; }