source: trunk/testcase/456/class.cpp@ 1456

Last change on this file since 1456 was 823, checked in by bird, 22 years ago

more statics.

  • Property cvs2svn:cvs-rev set to 1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.2 KB
Line 
1
2class ParentClass
3{
4private:
5 int iPrivate;
6 static char *pszPrivateStatic;
7
8protected:
9 int iProtected;
10 static char *pszProtectedStatic;
11
12public:
13 static char *pszPublicStatic;
14 static long lPublicStatic;
15 int iPublic;
16
17 ParentClass()
18 {
19 iPublic = 1;
20 iProtected = 2;
21 iPrivate = 3;
22 }
23
24 virtual ~ParentClass()
25 {
26 iPublic = -1;
27 iProtected = -2;
28 iPrivate = -3;
29 }
30
31 virtual int get() const
32 {
33 return iProtected + iPrivate;
34 }
35
36 virtual void set(int i)
37 {
38 iPublic = i;
39 iProtected = i + 1;
40 iPrivate = i + 2;
41 }
42
43 int getPrivate(void)
44 {
45 return iPrivate;
46 }
47};
48char *ParentClass::pszPrivateStatic = "PrivateStatic";
49char *ParentClass::pszProtectedStatic = "ProtectedStatic";