#include<iostream> using namespace std:: class person { private : int id; int phone; int pay; public: void set() {cout<<"사번입력"cin>>id; cout<<"연락처도입력">>cin>>phone; cout<<"급여입력">>cin>>pay;} void show(){ cout<<"id"<<id<<endl; cout<<"phone"<<phone<<endl; cout<<"pay"<<pay<<endl; } }; #include<iostream> using namespace std::
void main() { person s ; person &p p=&s; p->set(); p->show(); person s2; person &p2; p=&s; p->set(); p->show();
}
이상하게 다 맞는거같은데 집에서 깔은 비쥬얼 2010으로는 너무 찾기가힘드네요.... 밑에 빨간줄도 막 그어저잇고... 틀린점잇나요?