MCPcopy Create free account
hub / github.com/EricPengShuai/Interview / other

Function other

base_code/static.cpp:26–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26void other()
27{
28 static int a = 2;
29 static int b; // a,b为静态局部变量,具有全局寿命,局部可见,只第一次进入函数时被初始化
30
31 int c = 10; // c为局部变量,具有动态生存期,每次进入函数都初始化
32 a = a + 2;
33 i = i + 32;
34 c = c + 5;
35 cout << "---OTHER---\n";
36 cout << " i: " << i << " a: " << a << " b: " << b << " c: " << c << endl;
37 b = a;
38}

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected