C++ Programming Blog

 
 
 
#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;
}

 
 
Didn't find what you were looking for? Find more on Program of simple example of class and object