W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
#include
using namespace std; int main() { int myInt; float myFloat; double myDouble; char myChar; cout << sizeof(myInt) << "\n"; // 4 字节 (通常) cout << sizeof(myFloat) << "\n"; // 4 字节 cout << sizeof(myDouble) << "\n"; // 8 字节 cout << sizeof(myChar) << "\n"; // 1 字节 return 0; }