Technote87 [C++] 문제 2 문제 2 #include #include using namespace std; class Printer{ public: void SetString(string); void ShowString(); private: string a; }; void Printer::ShowString() { cout 2009. 9. 19. [C++] 연습문제 3-1 #include using std::cout; using std::endl; int acnt =0 , mcnt = 0,mlcnt=0,dcnt = 0; class Calculator{ public: int Add(int a,int b); int Div(int a,int b); int Min(int a,int b); void Init(){ a= 0; b= 0; } void ShowopCout(); private: int a,b; }; void Calculator::ShowopCout() { cout 2009. 9. 18. [C++] 클래스 내부 정의의 의미와 inline class Door{ private: int state; public: void Open(); void Close(); void ShowState(): }; inline void Door::Open(){ state=OPEN; } inline void Door::Close(){ state=CLOSE: } inline void Door::ShowState(){ cout 2009. 9. 18. [C++] public & private #include using std::cout; using std::endl; const int OPEN=1; const int CLOSE=2; class Door{ private: int state; public: void Open(){ state=OPEN; } void Close(){ state=CLOSE; } void ShowState(){ cout 2009. 9. 18. 이전 1 2 3 4 5 6 ··· 22 다음