Posts

Showing posts with the label pointer in cpp
 //pointer to object #include <iostream.h> #include <conio.h> class employee {     int code;     char name[10];     float salary;     public:         void get()         {             cout << " Enter code : ";             cin >> code;             cout << " Enter name : ";             cin >> name;             cout << " Enter salary : ";             cin >> salary;         }         void display()         {             cout...
 //this pointer #include <iostream.h> #include <conio.h> class emp {     int code;     public:         emp(int code)         {             this->code = code;         }         void display()         {             show();             cout <<"EMP CODE = " << code << endl;         }         void show()         {             cout << "\n\t show function called\n";         } }; void main() {     clrscr();     emp obj(23);     obj.disp...