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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "stdafx.h"
#include <iostream>
 
using namespace std; // 요 부분을 추가해야..  표준입출력 함수 사용가능
 
 
class Cat
{
    private:
        double itsAge;
        double itsWeight;
 
    public:
        Cat (double age, double weight);
        ~Cat() {}
 
        double GetAge()
        {
            return itsAge;
        }
     
        double GetWeight()
        {
            return itsWeight;
        }
};
 
Cat::Cat(double age, double weight)
{
    itsAge=age;
    itsWeight=weight;
}
 
 
 
int _tmain(int argc, _TCHAR* argv[])
{
 
    Cat Frisky(5.1, 7.3);
    Cat &rCat=Frisky;
 
    cout << "Frisky is " << Frisky.GetAge() << " years olds" << endl;
    cout << "Frisky weighs " << Frisky.GetWeight() << " pounds" << endl;
 
    int a;
 
    cin >> a;
 
    return 0;
}