How to use SIZEOF() in header file
To use SIZEOF() in #include
#include
int array1[100];
float array2[100];
double array3[100];
main()
{ printf("The size of int = %d bytes", sizeof(int));
printf("\nThe size of short = %d bytes", sizeof(short));
printf("\nThe size of long = %d bytes", sizeof(long));
printf("\nThe size of float = %d bytes", sizeof(float));
printf("\nThe size of double = %d bytes", sizeof(double));
printf("\nThe size of intarray = %d bytes", sizeof(array1));
printf("\nThe size of floatarray = %d bytes",
sizeof(array2));
printf("\nThe size of doublearray = %d bytes\n",
sizeof(array3));
return 0;
}
Result :
No comments:
Post a Comment