This commit is contained in:
parent
0ae5f80f36
commit
e78201ea5d
@ -9,11 +9,16 @@ steps:
|
||||
- cd class || exit
|
||||
- g++ construct.cpp -o construct && ./construct
|
||||
- g++ inherit.cpp -o inherit && ./inherit
|
||||
- cd ..
|
||||
- cd -
|
||||
|
||||
- cd stl || exit
|
||||
- g++ map.cpp -o map && ./map
|
||||
- cd ..
|
||||
- cd -
|
||||
|
||||
- cd interview || exit
|
||||
- g++ memcache.cpp -o memcache && ./memcache
|
||||
- cd -
|
||||
|
||||
- cd misc || exit
|
||||
- g++ sizeof.cpp -o sizeof && ./sizeof
|
||||
- cd -
|
14
misc/sizeof.cpp
Normal file
14
misc/sizeof.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
#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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user