sizeof(char) = 1 bytes.
sizeof(short int) = 2 bytes.
sizeof(int) = 4 bytes.
sizeof(long int) = 4 bytes.
sizeof(long long int) = 8 bytes.
sizeof(unsigned long long int) = 8 bytes.
sizeof(float) = 4 bytes.
sizeof(double) = 8 bytes.
请按任意键继续. . .
计算机:WIN7、32位操作系统
源码:
- #include <iostream>
-
-
#include <windows.h>
-
-
using namespace std;
-
-
-
-
int main()
-
-
{
-
-
cout << "sizeof(char) = " << sizeof(char) << " bytes." << endl;
-
-
-
-
cout << "sizeof(short int) = " << sizeof(short int) << " bytes." << endl;
-
-
cout << "sizeof(int) = " << sizeof(int) << " bytes." << endl;
-
-
cout << "sizeof(long int) = " << sizeof(long int) << " bytes." << endl;
-
-
cout << "sizeof(long long int) = " << sizeof(long long int) << " bytes." << endl;
-
-
cout << "sizeof(unsigned long long int) = " << sizeof(unsigned long long int) << " bytes." << endl;
-
-
-
-
cout << "sizeof(float) = " << sizeof(float) << " bytes." << endl;
-
-
cout << "sizeof(double) = " << sizeof(double) << " bytes." << endl;
-
-
-
-
//getchar();
-
-
system("pause");
-
-
return 0;
-
-
}
阅读(676) | 评论(0) | 转发(0) |