VC++ (datatype.cpp):
//Chapter 1 - datatype #include <iostream> using namespace std; int main(void) { cout << "type\tbyte" << endl; cout << "int\t" << sizeof(int) << endl; //4 cout << "long\t" << sizeof(long) << endl; //4 cout << "float\t" << sizeof(float) << endl; //4 cout << "double\t" << sizeof(double) << endl; //8 cout << "char\t" << sizeof(char) << endl; //1 cout << "bool\t" << sizeof(bool) << endl; //1 system("pause"); return 0; }
說明:
基本的變數型態與大小
沒有留言:
張貼留言