Logo 
Search:

C++ Programming Articles

Submit Article
Home » Articles » C++ Programming » Homework HelpRSS Feeds

Program of simple example of class and object

Posted By: Harrison Evans     Category: C++ Programming     Views: 11994

Write a program of simple example of class and object.

Code for Program of simple example of class and object in C++ Programming

#include<iostream.h>
#include<conio.h>
class data
{
    public:
    void date(int dd)
    {
        cout<<"\t"<<dd<<endl;
    }
    int day;
};

main()
{
    clrscr();
    data f1,f2;
    f1.date(07);
    f2.date(12);
    f1.day=2;
    cout<<"\t"<<f1.day<<endl;
    f2.day=12;
    cout<<"\t"<<f2.day<<endl;
}
  
Share: 


Didn't find what you were looking for? Find more on Program of simple example of class and object Or get search suggestion and latest updates.

Harrison Evans
Harrison Evans author of Program of simple example of class and object is from London, United Kingdom.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!