#include<iostream.h>
#include<string.h>
class Student{
private:
char name[20];
int age;
float height;
public:
void setInfo(char *_name, int _age, float _height){
strcpy(name, _name);
age= _age;
height = _height;
}
char getName();
int getAge();
float getHeight();
};
char Student::getName(){
return *name;
}
int Student::getAge(){
return age;
}
float Student::getHeight(){
return height;
}
void main(){
Student s;
s.setInfo("홍길동", 17, 178.3f);
cout << "이름 : " << s.getName() << endl;
cout << "나이 : " << s.getAge() << endl;
cout << " 키 : " << s.getHeight() << endl;
s.disp();
}
-----------------------------------------------------------
오류내용:
--------------------Configuration: gpgp_001 - Win32 Debug--------------------
Compiling...
asdf.cpp
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\gpgp_001\asdf.cpp(58) : error C2039: 'disp' : is not a member of 'Student'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\gpgp_001\asdf.cpp(9) : see declaration of 'Student'
Error executing cl.exe.
asdf.obj - 1 error(s), 0 warning(s)
-------------------------------------------------------------------------------------------------------
여기서 오류가 하나뜨는데 왜뜨는지모르겟네요..
도움 부탁드립니다 ㅠㅠ
|