Changeset 314


Ignore:
Timestamp:
Jun 11, 2003, 12:46:10 PM (22 years ago)
Author:
bird
Message:

a method and vft.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/testcase/456/simplecpp.cpp

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r313 r314  
     1/* verify that one can step thru all the code and that the this and obj variables make sense. */
    12#define USE_INLINE
    23class foo
     
    2021        #endif
    2122    }
     23
     24    virtual ~foo()
     25    {
     26        ch = 0;
     27    }
     28
     29    virtual void set(int ch)
     30    {
     31        this->ch = ch;
     32    }
     33
    2234#else
    2335    foo();
     36    virtual ~foo();
     37    virtual void set(int ch);
     38
    2439#endif
    2540};
     
    2944{
    3045    ch = 'k';
    31 #if 1
    3246    int ch2 = 1;
    3347    ch += ch2;
     
    4155    }
    4256    #endif
    43 #endif
     57}
     58
     59foo::~foo()
     60{
     61    ch = 0;
     62}
     63
     64void foo::set(int ch)
     65{
     66    this->ch = ch;
    4467}
    4568#endif
     
    4972{
    5073    foo obj;
     74    obj.set('k');
    5175    return 0;
    5276}
Note: See TracChangeset for help on using the changeset viewer.