49 - this

#include 
#include "Hannah.h"
using namespace std;

int main()
{
    Hannah ho(23);
    ho.printCrap();
    system("pause");
}

#ifndef HANNAH_H
#define HANNAH_H

class Hannah
{
public:
    Hannah(int);
    void printCrap();
private:
    int h;
};

#endif

#include 
#include "Hannah.h"
using namespace std;

Hannah::Hannah(int num):h(num)
{

}

void Hannah::printCrap()
{
    cout << "h=" << h << endl;
    cout << "this->h" << this->h << endl;
    cout << "(*this).h=" << (*this).h << endl;
}

你可能感兴趣的:(49 - this)