I can't find the following errors, help me please:
Error 3 error C2371: 'fraction::SetData' : redefinition; different basic types line 7
Error 2 error C2556: 'fraction fraction::SetData(float,float)' : overloaded function differs only by return type from 'void fraction::SetData(float,float)' line 7
Error 1 error C2628: 'fraction' followed by 'void' is illegal (did you forget a ';'?)line 6
Error 4 error C2628: 'fraction' followed by 'void' is illegal (did you forget a ';'?)line 3
Error 5 error C3874: return type of 'main' should be 'int' instead of 'fraction'line 4
Thaks "keskiverto" and "long double main", I've chanche some thins and one of them the semicolon at the end of the class, and now it runs but my problem is that the resolt is not coherent, can you help me please?
But, but .. you still have void main().
It should be int main()
It's defined that way in the C++ standard. If your compiler allows non-standard code, it doesn't help the learning process. Start out doing things the right way and you won't have to un-learn them in the future.
There is a standard to which all C++ compilers should conform. if you write int main() then it is guaranteed to be accepted by all C++ compilers.
On the other hand, if you write void main() then it may or may not be accepted, depending upon which compiler you use. When learning, it is important to start out writing standards-compliant C++ code, rather than depending upon quirks of a particular compiler.
(unfortunately those who teach do sometimes give incorrect advice ).