Papers/programming
CLASS vs. STRUCT
tomato13
2007. 9. 23. 17:32
#include
class CA{
public:
//CA(){};
//~CA(){};
void show(){
printf("CA\n");
}
void show2(){
printf("CA CA\n");
}
};
struct SA : public CA{
public:
void show(){
printf("SA\n");
}
};
int main(){
CA* pCA = new CA();
pCA->show();
delete pCA;
#if 1
CA objCA;
objCA.show();
#endif
#if 1
SA objSA;
objSA.show();
#endif
SA* pSA = new SA();
pSA->show();
pSA->show2();
delete pSA;
return 1;
}
> class와 struct의 차이점은?