헤더 파일을 이용한 파일 분할

Door.h
#include <iostram>
using std::cout;
using std::endl;

const int OPEN=1;
const int CLOSE=2;

class Door
{
private:
    int state;

public:
    void Open();
    void Close();
    void ShowState();
}

Door.cpp
#include"Door.h"
void Door::Open()
{
    state=OPEN;
}
void Door::Close()
{
    state=CLOSE;
}
...........생략
}

Main.cpp
#include"Door.h"

int main()
{
    Door d;

    d.Open();
    d.ShowState();

    return 0;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

 characters available

4 + 6 =