source: branches/libc-0.6/testcase/456/simplecpp.cpp@ 3799

Last change on this file since 3799 was 314, checked in by bird, 22 years ago

a method and vft.

  • Property cvs2svn:cvs-rev set to 1.4
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 971 bytes
Line 
1/* verify that one can step thru all the code and that the this and obj variables make sense. */
2#define USE_INLINE
3class foo
4{
5 char ch;
6public:
7#ifdef USE_INLINE
8 foo()
9 {
10 ch = 'k';
11 int ch2 = 1;
12 ch += ch2;
13 int ch3 = 1;
14 ch += ch3;
15 #if 1
16 if (ch == 123)
17 {
18 int ch4 = 23;
19 ch -= ch4;
20 }
21 #endif
22 }
23
24 virtual ~foo()
25 {
26 ch = 0;
27 }
28
29 virtual void set(int ch)
30 {
31 this->ch = ch;
32 }
33
34#else
35 foo();
36 virtual ~foo();
37 virtual void set(int ch);
38
39#endif
40};
41
42#ifndef USE_INLINE
43foo::foo()
44{
45 ch = 'k';
46 int ch2 = 1;
47 ch += ch2;
48 int ch3 = 1;
49 ch += ch3;
50 #if 0
51 if (ch == 123)
52 {
53 int ch4 = 23;
54 ch -= ch4;
55 }
56 #endif
57}
58
59foo::~foo()
60{
61 ch = 0;
62}
63
64void foo::set(int ch)
65{
66 this->ch = ch;
67}
68#endif
69
70
71int main(int argc, char **argv)
72{
73 foo obj;
74 obj.set('k');
75 return 0;
76}
Note: See TracBrowser for help on using the repository browser.