3 errors , Please breif me about errors. thanks

//Write a program by using a class to input two values using a member function
//of a class . Display the sum of the two values by using another member function
//the class
#include <iostream.h>
#include <conio.h>
#include <stdlib.h>

using namespace std;

class sum
{
private:
int n,m;
public:
void get(int a,int b)
{
n = a;
m = b;
}
void display(void)
{
cout<<"Sum = "<<n+m;
}
}
main()
{
sum s;
int x, y;
cout<<"Please Enter First No. = ";
cin>>x;
cout<<"Please Enter 2nd No. = ";
cin>>y;
s.get(x,y);
s.display();


getch();
}



errors:
26 C:\Documents and Settings\Administrator\My Documents\class2.cpp semicolon missing after declaration of `class sum'
26 C:\Documents and Settings\Administrator\My Documents\class2.cpp `main' must return `int'
26 C:\Documents and Settings\Administrator\My Documents\class2.cpp ISO C++ forbids defining types within return type
2 C:\Dev-Cpp\include\c++\3.3.1\backward\backward_warning.h:32 #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
4 C:\Documents and Settings\Administrator\My Documents\class2.cpp from C:/Documents and Settings/Administrator/My Documents/class2.cpp
4 C:\Dev-Cpp\include\c++\3.3.1\backward\iostream.h:31, from C:\Documents and Settings\Administrator\My Documents\class2.cpp In file included from C:/Dev-Cpp/include/c++/3.3.1/backward/iostream.h:31, from C:/Documents and Settings/Administrator/My Documents/class2.cpp
semicolon missing after declaration of `class sum'

That means there is a semicolon missing after the declaration of class sum


`main' must return `int'

That means main must return int.

This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h>

That means you should use #include <iostream> instead of <iostream.h>

What's so hard about reading the error messages here?
The error messages are clear enough. Why do not you read messages?!

Names of included headers shall be iostream and cstdlib. After the closing brace of the class definition there shall be a semicolon. Function main shall be defined with return type int.
- Class names usually begin with a capital letter. Not really a mistake, but its good to follow certain rules.

- get() should be set().

- The enclosing bracket for a class is followed by a semicolon

1
2
3
4
5
 
class Sum 
{
    // all your codebase are belong to us 
}; 


- It should be

 
int main()

Sir i have not read about a semicolon after a class name.

right now i don't know about int main(),

i have changed header files iostream and cstdlib

There are still 3 errors .
please breif me.

Thanks
Thanks sir i got , i am sorry .
Topic archived. No new replies allowed.