I have just begun implementing an inheritance program from my course. Unfortunately, the sample program that illustrates how it works also contains a previously written implementation of a 3d vector class with overloaded insertion/extraction operators. It's these operators that are showing errors. Since the code is kind of long, I'll try to summarize what my program looks like.
If I comment out these lines, the program runs, but without the overloaded operators, the function printStats() outputs gibberish values, that look like addresses. For example: 00FBF88C instead of 5, 6, -3.
I tried making the overloads friends in both A and B. Still the same.
Can you even combine friend and inheritance? Or is this a completely different problem?
So now I guess that the error message might say: "I cannot decide whether to convert Vector3* to void* or to const Vector3&"
But that is just a wild guess.
Error 1 error C2143: syntax error : missing ';' before '&'
Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Error 3 error C2065: 'is' : undeclared identifier
Error 4 error C2065: 'v' : undeclared identifier
Error 5 error C2275: 'Vector3' : illegal use of this type as an expression
Error 6 error C1903: unable to recover from previous error(s); stopping compilation
They keep on repeating after that, all pointing to the two lines I mentioned.
<< does have the implementation written, and it works if I print a vector by itself. The problem is passing it off to printStats().
OMG ARE YOU SERIOUS?!
I forgot to include iostream in inheritance.h file.....Pff, it seems I'm beginning to overlook the simple things lately.
Sorry for wasting your time guys, and thanks LB for saving me the rest of the day lol.