Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 안드로이드 개발 2.0
- 인기있는 블로그 만들기
- 안드로이드2.0
- 스마트폰 배경화면
- 안드로이드 배경화면
- android
- 안드로이드2.0개발
- sky 시리우스폰
- 아이폰 배경화면
- 하루한마디영어
- 스카이 안드로이드폰 시리우스
- SKY 시리우스
- 안드로이드개발
- Form Stuff
- 안드로이드 개발 2.0 강좌
- 안드로이드폰
- 안드로이드 2.0 개발
- 안드로이드
- objective-c
- 구글안드로이드
- 구글 안드로이드
- 영어
- MapView
- 구글 안드로이드 개발
- 스카이 안드로이드폰 시리우스 K양 동영상
- 안드로이드 바탕화면
- 아이폰 바탕화면
- 안드로이드 개발
- 하루 한마디 영어
- 안드로이드 개발 강좌
Archives
- Today
- Total
moozi
c++ Student클래스 본문
#include <iostream>
#include <string>
using namespace std;
class Student{
private:
string name;
int age;
string address;
public:
Student() { }
Student(string n) {
name = n;
}
string getName() {
return name;
}
void setName(string n) {
name = n;
}
int getAge() {
return age;
}
void setAge(int a) {
age = a;
}
string getAddress() {
return address;
}
void setAddress(string a) {
address = a;
}
};
int main() {
//홍길동 인스턴스생성
Student *hgd = new Student("홍길동");
cout << "hgd의 이름 : " << hgd->getName() << endl;
hgd->setAge(30);
cout << "hgd의 나이 : " << hgd->getAge() << endl;
delete hgd; // 생략하면 메모리누수 가능성이 커짐.
return 0;
}
Comments