cpp_playground/misc/sizeof.cpp

14 lines
294 B
C++
Raw Normal View History

2022-11-28 15:25:44 +08:00
#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;
}