C언어
2013.03.28 00:16

ex1

조회 수 149 추천 수 0 댓글 1
?

단축키

Prev이전 문서

Next다음 문서

이전 다음 위로 아래로 댓글로 가기 인쇄 목록
?

단축키

Prev이전 문서

Next다음 문서

이전 다음 위로 아래로 댓글로 가기 인쇄 목록
Extra Form
  • profile
    너에게제공 2013.03.28 00:17 글쓴이
    class Person
    {
    private:
    string name;
    int age;
    char gender;
    public:
    Person(string n="",int a=0,char g='M'){name=n;age=a;gender=g;}

    void setName(string n){name=n;}
    string getName(){return name;}
    void setAge(int a){age=a;}
    int getAge(){return age;}
    void setGender(char g){gender=g;}
    char getGender(){return gender;}
    void display(){ cout<<"이름 : "<<name<<endl;
    cout<<"나이 : "<<age<<endl;
    cout<<"성별 : "<<gender<<endl;}

    };
    void main()
    {
    Person p,s("봄양",22,'f');
    s.display ();
    p.display();
    }

List of Articles
번호 분류 제목
28 JSP 홈페이지
27 C언어 as
26 XML asdf file
25 E비즈니스 f file
24 JSP 1 file
23 JSP 9 file
22 C언어 ctl.seoil.ac.kr
21 C언어 10월18일 c언어 실습 file
20 C언어 C언어자료 file
19 C언어 c언어 if문
18 JSP JSP 소스파일 file
17 E비즈니스 E_비즈니스 PPT file
16 XML xml 10-12일 강의중 실습 file
15 XML XML 본문 예제소스 file
14 ㅂㅈ file
Board Pagination Prev 1 2 3 4 5 6 7 8 Next
/ 8