I am writing a program that has one header file. However, I have always put "using namespace std;" after all the includes which means that the header file never sees that declaration. The problem that I have come across is when I try to set a function to return a string, I would have to put std::string in order for the program to compile.
So my question is should I use std::string in the header, or should I include "using namespace std" inside the header file?
It's bad practice to put usingnamespace std; in a header file, as any file which includes the header will find itself with that using whether it wants it or not.
Better to explicitly put std::string in the header.