Thread: greets
View Single Post
Old 10-14-2004, 01:54 PM   #7 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
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.
__________________
Valmont is offline   Reply With Quote