Drop the Water::. You are already inside the water class. Also what is the return type of this operator function?
cout << "Sum_of_Both:" << Sum << endl;
You mean Sum.liter?
at first i didnt used Water:: the compiler told me to do this ; /
yea i mean Sum.liter
edited how u said
using namespace std;
liter = a;
neu.liter = liter + b.liter;
return(neu.liter); // Why I cant write just return(neu) like Bucky did? I am using C++11 and Bucky used it to because
} // he uploaded at 2011 I don't get it.
}; // And why cant I use return(liter + b.liter)
cout << "Redsea:" << Redsea.liter << endl;
cout << "Ocean:" << Ocean.liter << endl;
cout << "Sum_of_Both:" << Sum.liter << endl;
sh-4.3$ g++ -std=c++11 -o main *.cpp
main.cpp:13:26: error: ISO C++ forbids declaration of 'operator+' with no type [-fpermissive]
// Why the hell I get this error? I did exact the same like Bucky did... I also tried it with operator+(int b) and Water b.liter
I keep going watching Buckys C++ Tutorials and new Questions are going to pop up : / Should I create to every question a new thread or add it in this thread!? I mean the source code is so long isnt there a "spoiler-function"?