how the this class pointer works

W
Shared by: chandrapro
-
Stats
views:
12
posted:
6/11/2010
language:
English
pages:
1
Document Sample
scope of work template
							#include <iostream>

using namespace std;

class MyClass {
   int i;
public:
   void load_i(int val) { this->i = val; }
   int get_i(void) { return this->i; }
};

main(void){
  MyClass o;

    o.load_i(100);
    cout << o.get_i();

    return 0;
}

						
Shared by: Chandra Sekhar
About
My name is chandra sekhar, working as professor
Related docs
Other docs by chandrapro
Analog To Digital Conversion
Views: 49  |  Downloads: 2
150 Typical Job Interview Questions
Views: 31  |  Downloads: 4
Advanced Nutrition and Food
Views: 16  |  Downloads: 0