#include <stdio.h>
int main()
{
    printf("\nA Char is %lu bytes"sizeofchar ));
    printf("\nAn int is %lu bytes"sizeofint ));
    printf("\nA short is %lu bytes"sizeofshort ));
    printf("\nA long is %lu bytes"sizeoflong ));
    printf("\nA long long is %lu bytes\n"sizeoflong long ));
    printf("\nAn unsigned Char is %lu bytes"sizeof( unsigned char ));
    printf("\nAn unsigned int is %lu bytes"sizeof( unsigned int));
    printf("\nAn unsigned short is %lu bytes"sizeof( unsigned short ));
    printf("\nAn unsigned long is %lu bytes"sizeof( unsigned long ));
    printf("\nAn unsigned long long is %lu bytes\n",sizeof( unsigned long long ));
    printf("\nfloat is %lu bytes"sizeoffloat ));
    printf("\nA double is %lu bytes\n"sizeofdouble ));
    printf("\nA long double is %lu bytes\n"sizeoflong double ));
return 0;
}
muhuacat@muhuacat:~/bin# gcc -o c c.c 
muhuacat@muhuacat:~/bin# ./c

A Char is 1 bytes
An int is 4 bytes
short is 2 bytes
long is 8 bytes
long long is 8 bytes

An unsigned Char is 1 bytes
An unsigned int is 4 bytes
An unsigned short is 2 bytes
An unsigned long is 8 bytes
An unsigned long long is 8 bytes

float is 4 bytes
double is 8 bytes

long double is 16 bytes

 

相关文章:

  • 2022-01-17
  • 2021-12-19
  • 2022-12-23
  • 2022-01-21
  • 2022-01-06
  • 2021-04-13
  • 2021-07-17
猜你喜欢
  • 2021-08-07
  • 2022-01-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案