is there a header file for namespace or is it just my compiler?
is there a header file for namespace or is it just my compiler?
namespace is a keyword, which means it is your compiler.
Are you sure you are using a C++ compiler and not a C compiler?
If you have an old version then namspaces will probably not work properly......but as you like borland, you can download the newest version for free from their site and that should support them fineOriginally posted by drdroid
its called borland c++
Damn straightOriginally posted by Troll_King
You probably perfer not bathing as well.
Fordy's suggestion is a good one. Borland 4.0 supports the standard namespace and the download is version 5.5, so you're all set on that issue.
Now, where Troll_King's admonition is concerned, I would offer this:
I don't know whether Troll_King is backing Mr. Stroustrup up here, or vice-versa, but the message is clear enough.It is generally in poor taste to dump every name from a namespace into the global namespace.
-Bjarne Stroustrup
Some might offer, with some validity, that, for smaller applications, 'using namespace std;' isn't so big an issue. Perhaps, but neither is it difficult to avoid using it in small applications, either.
A trivial example, of course, but illustrates how to avoid extra typing if you don't have the inclination.Code:#include <string> #include <iostream> #include <cstdlib> // for system("PAUSE") using std::cout; using std::cin; using std::endl; using std::string; int main(void) { string name; cout << "Type in your name -> "; getline(cin, name); // does not stop read at 'whitespace' chars cout << "\nHello, " << name << "!" << endl << endl; system("PAUSE"); return 0; }
-Skipper
"When the only tool you own is a hammer, every problem begins to resemble a nail." Abraham Maslow