c++�� ������ ������ ��������
MFC�� ���������� ������������ ���� ���� �������� ���� ������ ���� ������ ����������.
������ ����,������ ���� ������ �� ������, ���� ������ ���� ������ �������� ��������
�������� ���� ������ ������������ ������������ ������, �� �������� �������� �������� namespace�� ��������.
namespace�� ������ ���� �������� ���� ���� ������ �������� �������� ������ ����.
������ ��_1]
string�� �������� ���� ���� �������� �� ��, ������ ������ ������ ������ ������ ���� ����, ahn_string �� ���������� �������� ������. ������ ���� �������� ���� ���� string�������� ���� ������ ��������.
������ ����
namespace ahn { class string{ .... } } ������ ���� ��������
void main()
{ using namespace ahn; string iamstring = "baobo ������"; ... }
������ ��������, namespace ahn {} ���� ������ string �������� ��������.
1) �������� ���������� ������ ���� ��������. (c++�� ���� ����)
void main() { ahn::string iamstring = "baobo ������"; std::string iamstdstring = "baobo std ������"; }
2) using directive�� �������� ������ customer ������ ���������� ������ ������ ����.
void main() { using ahn::string; string iamstring = "baobo ������"; }
ahn���� ������ string������ ������ ���������� ���� ����.
������, ������������ std���� c++���� ���� �������� �������� ������ ������
������ ������ �������� �������� ������ �� �� namespace�� ����.
������ ��_2]
������ ���� ...
fully qualified name���� ������ ������ using directive�� �������� ������ customer ������ ������ �� ���� ������...
������ �� ��������..
#include <iostream>
using namespace std;
namespace TestName1 {
int a = 5;
}
namespace TestName2 {
int a = 6;
}
int main( void )
{
cout << TestName1::a << endl;
cout << TestName2::a << endl;
return 0;
}
���������� �������� |
할 수 있다고 믿는 사람이 성공한다(월터 D.윈틀) edu2015_박재희교수_손자병법 메모장_시스템 신용_산업기상도 TryEssence_캐릭터애니메이션 |