#include <cstdio>
int main() {
int n = 0;
size_t intSize;
intSize = sizeof(int);
printf("n = %d, n has %zd bytes; all ints have %zd bytes.\n", n, sizeof(n), intSize);
return 0;
}
运行结果
C:\Users\dong\CLionProjects\untitled\cmake-build-debug\untitled.exe
n = 0, n has 4 bytes; all ints have 4 bytes.
Process finished with exit code 0