Wednesday, May 1, 2013

C++ Class Example Type -1

No comments

Source Code

#include "iostream"
using namespace std;
class simple
{
int a;
public:
void set_a();
void get_a();
}m1,m2,m3;
void simple::set_a()
{
a=4;
}
void simple::get_a()
{
cout<<"\n a is "<<a;
}

int main()
{
m2.get_a();
m2.set_a();
m2.get_a();

return 0;
}

0 comments:

Post a Comment

Entries RSS Comments RSS

Sample Text

Pages


Copyright © Lovely Codes
Powered by Blogger
Distributed By Free Blogger Templates | Design by N.Design Studio
Blogger Theme by Lasantha - PremiumBloggerTemplates.com