include stdafx class Triad public int int int Triad void increment_a v

 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
#include "stdafx.h"
class Triad{
public:
int a;
int b;
int c;
Triad(){ a = 0; b = 0; c = 0; }
void increment_a(){ a++; }
void increment_b(){ b++; }
void increment_c(){ c++; }
void show(){
cout << a << " " << b << " " << c << endl;
}
};
class Date :public Triad{
private:
int year;
int month;
int day;
public:
};
int _tmain(int argc, _TCHAR* argv[])
{
Date D;
D.increment_a();
D.show();
return 0;
}