[C++ 기초 문법] 클래스 생성자와 파괴자
클래스 생성자와 파괴자 아래와 같은 헤더파일에서, public 멤버의 함수인 acquire을 사용하지 않고 바로 Stock 클래스를 선언하려면 어떻게 해야할까? [stock.h] #ifndef STOCK #define STOCK #include using namespace std; class Stock { private: //비공개 멤버,클래스 내에서만 접근 가능 string name; int shares; float share_val; double total_val; void set_total() { total_val = shares * share_val; } public: //공개 멤버, 클래스 외부에서도 접근 가능 void acquire(string, int, float); void buy(int,..