도대쳌 이건 무슨 경우입니까 ;;
희라
#includeiostream
using std::endl;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;using std::cout;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
class Person{ int age; char name[20]; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
public: int GetAge() const { return age; } const char* GetName() const { return name; } Person(int _age=1, char* _name=nonmae) { age=_age; strcpy(name,_name); }};
class Student: public Person{ char major[20];public: Student(char* _major) { strcpy(major,_major); } const char* GetMajor() const { return major; } void ShowData() const { cout 이름 : GetName()endl;;;;;;;;;;;;;; cout 나이 : GetAge()endl;;;;;;;;;;;;;; cout 전공 : GetMajor()endl;;;;;;;;;;;;; } ;;;;;;;;;;;;;;};
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;int main(void){ Student Kim( Computer ); Kim.ShowData();12345616616;;;;;;;;;;;;;;;;;; return 0;};;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
이렇게 햇는데 에러가 안뜨네요 ;;
원래 상속 공부하던도중에
마지막에
int main(void){Student Kim( Computer ); Kim.ShowData(); return 0;};
이렇게 되있어서 이상하다했는데 ..
에러가 안뜨길래 ;;
이유가 뭐죠?
-
아리에스
지식 하나 얻어갔네요 감사감사.