![](sad.gif)
'using namespace std' problems
ok, in one of my header files, ive declared ''using namespace std;''. Later on in one of me source files, im using a function that returns an ifstream class. When I try to compile, i get error C2872: ''ifstream'': ambiguous symbol. Anyone have any idea how to fix this? I''ve scoured MSDN for any solutions, and have came up with nothing. I practically have that error memorized
comments/questions/fixes/flames?
![](sad.gif)
Never import the std namespace in header files. Use explicit import.
i.e In header file, do this
void F( std::string &s );
rather than
using namespace std;
void F( string &s );
i.e In header file, do this
void F( std::string &s );
rather than
using namespace std;
void F( string &s );
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement