Download presentation
Presentation is loading. Please wait.
Published byHelmi Kähkönen Modified over 6 years ago
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.