In your class you haven't defined what the types of x and y are in your member function add.
Other then that, you have two other issues I see right now:
1) Don't use gotos here; use a loop or something instead
2) Sum is a rather useless class...but this is probably for an assignment I suppose
btw, we learn C++ in school on a TurboC compiler. My eyes kinda hurt coz of the blue screen, so I switched to DevC++ and Code::Blocks. This thing here was done in Code::Blocks. Maybe there's some setting I need to fix? There's only so much in Code::Blocks I don't understand...
You have defined member variables 'x' and 'y' of the class, but you have not defined the parameters of the member function "add". Furthermore, reusing the names 'x' and 'y' for parameters creates confusion, because the class has members with those names.
hi, im sorry for deserting the topic here. i never solved the problem. however, i started using dev c++ and found out that i had the errors only in code blocks. the program worked fine on dev c++. i have no idea why code blocks is giving me a hard time...
The problem's fixed. I uninstalled code blocks and deleted all files with that keyword by performing a search. Turns out that was the problem. Code blocks works fine now. Although I have no idea why.