Presentation is loading. Please wait.

Presentation is loading. Please wait.

COPY ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT

Similar presentations


Presentation on theme: "COPY ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT"— Presentation transcript:

1 COPY RIGHT@ ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT
C++ CODES PART#10 COPY ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT

2 A SIMPLE CLASS WITH OBJECTS
// A SIMPLE CLASS #include<constream.h> class smallobj {private: int somedata; public: void setdata(int d) COPY ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT

3 COPY RIGHT@ ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT
Continue…. {somedata=d;} void showdata() {cout<<"data is"<<somedata<<endl;} }; void main() {clrscr(); COPY ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT

4 COPY RIGHT@ ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT
Continue…. smallobj s1,s2;s2; s1.setdata(1066); s2.setdata(1776); s1.showdata(); s2.showdata(); getch();} COPY ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT

5 COPY RIGHT@ ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT
Output…. COPY ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT


Download ppt "COPY ENGR.SABA MUGHAL FROM COMPUTER SYSTEMS DEPARTMENT"

Similar presentations


Ads by Google