Yes. Although it is not advisable to do so. This is what I earlier wrote:
Ok.
C++ has a standard as defined by a certain comittee called ISO. ISO C++ is the international operating independent C++ standard. ANSI, also important, is the American C++ standard.
The fact that I am using
<iostream> etcetera WITHOUT the .h extension means that I am going to to program in
standard C++. But using standard methods and functions and algorithms and containers means that I need to enter this all the time:
std::cout; std::cin ; std::getline; and so forth.
So what I do is define it in once like this:
Code:
using std::cout;
using std::cin;
using std::endl;
using std::string;
I could do it even simpler:
using namepsace std; .
But now I am forcing everybody to use standard C++ for the headers that I included in the file. That is not very professional. That's why I did it this way. A sort of in-between way.