#include <iostream>
using namespace std;
char comment[100] = "순정 전역변수;
namespace 훈이
{
char comment[100]="훈이는 착하다";
}
int main(void)
{
::comment = "변종 전역변수"; // 전역변수 comment에 접근
훈이::comment = "에잇 훈발놈"; // 훈이 namespace의 comment에 접근
cout<< "전역변수 : " << ::comment << std::endl;
cout<< "훈이 : " << 훈이::comment << std::endl;
return 0;
}
SimpleFunc.h :
SimpleFunc.cpp :
SimpleMain.cpp :