This commit is contained in:
parent
0ae5f80f36
commit
e78201ea5d
43
.drone.yml
43
.drone.yml
@ -1,19 +1,24 @@
|
|||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: default
|
name: default
|
||||||
steps:
|
steps:
|
||||||
- name: test
|
- name: test
|
||||||
image: gcc:latest
|
image: gcc:latest
|
||||||
commands:
|
commands:
|
||||||
- g++ hello.cpp -o hello && ./hello
|
- g++ hello.cpp -o hello && ./hello
|
||||||
|
|
||||||
- cd class || exit
|
- cd class || exit
|
||||||
- g++ construct.cpp -o construct && ./construct
|
- g++ construct.cpp -o construct && ./construct
|
||||||
- g++ inherit.cpp -o inherit && ./inherit
|
- g++ inherit.cpp -o inherit && ./inherit
|
||||||
- cd ..
|
- cd -
|
||||||
|
|
||||||
- cd stl || exit
|
- cd stl || exit
|
||||||
- g++ map.cpp -o map && ./map
|
- g++ map.cpp -o map && ./map
|
||||||
- cd ..
|
- cd -
|
||||||
|
|
||||||
- cd interview || exit
|
- cd interview || exit
|
||||||
- g++ memcache.cpp -o memcache && ./memcache
|
- 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