‼️ 포인트를 배우기 위해 꼼꼼히 알아두기!
‼️ 여기도 대체적으로 c구조


#include <iostream>
using namespace std;
int g_i = 0;
void Test() {
int i = 0;
++i;
cout << "Test: " << i << endl;
}
void Test2() {
++g_i;
cout << "Test2: g_i = " << g_i << endl;
}
void Test3() {
++g_i;
// int a = 100; // main에서 선언한 a에는 접근 불가
// a = 100; // 컴파일 에러 발생
}
int main() {
Test();
Test();
Test();
Test2();
Test2();
Test2();
int a;
a = 10;
Test3();
return 0;
}
int g_i = 0;
void Test3()
{
++g_i;
a = 100;
}
int main()
{
int a;
Test3();
return 0;
}