cpp_playground/misc/sizeof.cpp
wangjiacai e78201ea5d
All checks were successful
continuous-integration/drone/push Build is passing
add sizeof
2022-11-28 15:27:06 +08:00

14 lines
294 B
C++

#include <iostream>
using namespace std;
char strs[2][1024];
int main()
{
cout << sizeof(strs) << endl;
cout << sizeof(strs[0]) << endl;
cout << sizeof(strs[0][0]) << endl;
for (size_t i = 0; i < sizeof(strs) / sizeof(strs[0]); i++)
cout << sizeof(strs[i]) << endl;
}