Please correct the code it has 3 errors, " int main "

//Write a program to input a date and print on the
//screen by using class
#include <iostream.h>
#include <conio.h>
#include <stdlib.h>

using namespace std;

class edate
{
private:
int y,m,d;
public:
void gdate(void)
{
cout<<"Enter Year = "<<endl;
cin>>y;
cout<<"Enter Month = "<<endl;
cin>>m;
cout<<"Enter Date = "<<endl;
cin>>d;
}
void pdate (void)
{
cout<<"Date is = "<<endl;
cout<<d<<" / "<<m<<" / "<<y;
}
}
main()
{
edate pak;
pak.gdate();
pak.pdate();
getch();
}
Please paste the error you are getting.

For starters the error seem to be :

1> Class declaration should end with ; (for eg class edate { ...}; )
2> the template for main should be "int main(int,char **)
Topic archived. No new replies allowed.