Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

friend overloaded extraction operator without namespace std

$
0
0
Just wondering if anyone could point me in the right direction. I have a friend extraction operator that works if i include namespace std; but fails if i do not. can anyone give me a hint?
ostream& operator << (ostream &out, coins &value)



this is also a friend function, so i have this in my class.h file (as a friend)
in my functions.h file (as the prototype) and in my functions.cpp file (the logic).

ive tried making it

std::ostream& operator....
std::ostream& operator std::<< (etc)

but i just cant see where im going wrong. My compiler keeps telling me 'ostream does not name a type'

thank you

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>