DEFINITIONS
This source file includes following functions.
- Person
- Person
- get_name
- get_age
- set_age
1 #include <stdio.h>
2
3 class Person {
4 private:
5 const char *name;
6 int age;
7
8 public:
9 Person(const char *name, int age);
10 const char * get_name();
11 int get_age();
12 void set_age(int i);
13 };
14
15 Person::Person(const char *name, int age)
16 : name(name), age(age)
17 {
18
19 }
20
21 const char *
22 Person::get_name()
23 {
24 return name;
25 }
26
27 int
28 Person::get_age(){
29 return age;
30 }
31
32 void
33 Person::set_age(int i){
34 age = i;
35 }