|
-
Feb 19th, 2005, 04:31 AM
#1
Thread Starter
Hyperactive Member
using namespace or std:: ?
Hello... havent been here in YEARS... lol yeah years..
anyway... I have a quick question:
I see different sources do this differently so I wanted to know witch one to stick with and what is better:
should I use the "using namespace std;" OR on every line it should look like "std::cout << " and so on
Thanks a lot
-Emo
-=VB6 Enterprise Edition=-
-=VC++6Enterprise Edition=-
«¤E³m°O²™¤»
-
Feb 19th, 2005, 01:49 PM
#2
Re: using namespace or std:: ?
It really depends. For a small project, go ahead and through the entire namespace in there. Chances are you won't have a naming conflict. In a large project, you probably wont have a naming conflict either, but the chances are a lot greater.
Anyway, There is a third option . You can pick certain items from the namespace to use:
Code:
using std::cout;
using std::cin;
Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.
-
Feb 19th, 2005, 11:22 PM
#3
Re: using namespace or std:: ?
I would suggest never to use a using namespace statement instead of a header file.
-
Feb 20th, 2005, 11:20 AM
#4
Re: using namespace or std:: ?
There's just one rule, everything else is a matter of taste.
The rule is: never use using at the top level of a header file.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|