bsc

Comprehensive codebase and cou...
Log | Files | Refs | Activity | README | LICENSE

root / semester_2 / eduincs / pgrm_014.cpp

pgrm_014.cpp (409B)


      1 /* `this` pointer */
      2 
      3 #include<iostream>
      4 using namespace std;
      5 class myclass {
      6 private:
      7 	int value1;
      8 	int value2;
      9 public: 
     10 	void setValue(int v, int value2) {
     11 		this -> value1 = v;
     12 		this -> value2 = value2;
     13 	}
     14 	void printValue() {
     15 		cout << "Value1: " << this -> value1 << endl;
     16 		cout << "Value2: " << this -> value2;
     17 	}
     18 };
     19 
     20 int main() {
     21 	myclass obj;
     22 	obj.setValue(23, 123);
     23 	obj.printValue();
     24 	return 0;
     25 }
© notamitgamer • Site Built: 2026-09-05 01:53:16 UTC • git-mirror commit: c170d72 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror