Credit : FORTH-RIGHT (http://forth-right.blogspot.com)
Using this code you can check your size of data types in your compiler.
OUTPUT:
Visual Studio 2010
Using this code you can check your size of data types in your compiler.
#include<stdio.h>
#include<string.h>
int main ()
{
int A[10];
A[0]= sizeof(int);
A[1]= sizeof
(short int);
A[2]= sizeof(long);
A[3]= sizeof(float);
A[4]= sizeof(double);
A[5]= sizeof(long double);
A[6]= sizeof(char);
A[7]= sizeof(unsigned long);
A[8]= sizeof(long long int);
printf("Default\t\t%d\n",A[0]);
printf("Short\t\t%d\n",A[1]);
printf("long\t\t%d\n",A[2]);
printf("float\t\t%d\n",A[3]);
printf("double\t\t%d\n",A[4]);
printf("long
double\t%d\n",A[5]);
printf("char\t\t%d\n",A[6]);
printf("unsigned
long\t%d\n",A[7]);
printf("long
long int\t%d\n",A[8]);
getchar ();
return 0;
}
No comments:
Post a Comment