![]() |
|
#1
|
|||
|
|||
friend functions errorHi, I've just learned how to use the friend functions and I'm trying to overload operator<< for each of my classes so I can output data in a more efficient way.
For the moment, I've just added the declaration of the friend function into each of my classes and it seems to be OK for most of them except 2. Since I'm doing the same thing in each class, how is it possible to get errors in only 2 of them. Here's a sample: CPP / C++ / C Code:
With the errors: Code:
|
|
#2
|
|||
|
|||
|
Forget it guys, I was just mixed up with header files, I cleaned up my mess and now it seems to work fine. Just a beginner mistake!
|
|
#3
|
|||
|
|||
Re: friend functions errorI know it has been awhile since this post was made...but, I am new to C++ development and am getting this exact error. Can you tell me how you resolved it?
|
Recent GIDBlog
Writing a book by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Tutorial] GUI programming with FLTK | dsmith | FLTK Forum | 10 | 03-Oct-2005 15:41 |
| What is "Ambigious symbol" ??*( a compilation error) | small_ticket | C++ Forum | 2 | 07-Jan-2005 21:10 |
| Error C2146: syntax error : missing ',' before identifier 'C4' | mattchew008 | C++ Forum | 2 | 19-Dec-2004 06:06 |
| Can enum have same name as class? | crystalattice | C++ Forum | 3 | 08-Dec-2004 16:43 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The