네임스페이스

1.231.2.125 (토론)님의 2018년 2월 19일 (월) 17:44 판 (→‎예시: C#)

1 개요

namespace
이름공간, 명칭공간, 네임스페이스
  • 개체를 구분할 수 있는 범위
  • 사례: C++, C#, Java 등

2 예시: C++

namespace Box1{
   int boxSide = 4;
}
 
namespace Box2{
   int boxSide = 12; 
}
 
int main () {
  cout << Box1::boxSide << endl;  //output 4
  cout << Box2::boxSide << endl;  //output 12
  return 0;
}

3 같이 보기

4 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}