Code: Select all
class T {
unsigned value;
public:
T() {value = 0;}
T(int v) {value = v%13;}
friend std::ostream& operator <<(std::ostream&, const T&); // i dont understand
};
std::ostream& operator <<(std::ostream& out, const T& data) { // i dont understand
return out << data.value;
}
Anyway, this code actually works, however i would like to modify it imensely, and in order to do that i need to understand it and af few tutorials about uderdefined datatypes wouldnt be bad either.
I feel bad revealing how little i know, but i need the help.
Anyone?