Sign in to follow this  
Bombario

using namespace std -- Does that make the exe huge?

Recommended Posts

(obviously talking about C++) Should I just say using std::whatever instead of using namespace std;? I made a really small text-based game, and it was like 500k...I figured it'd be under 50, so is it because I said using namespace std? Also, I can just throw those using std::whatever declarations in a header, right?

Share this post


Link to post
Share on other sites
Quote:
Original post by Bombario
Should I just say using std::whatever instead of using namespace std;?

In headers, you should preferably fully qualify all the names (std::vector, std::string, et cetera), and not use any using directives. The less you dump into the global namespace, the better. (using bla::whatever over using namespace bla is of course less bad, but as others have pointed out, the reasons have nothing to do with the size of the finished executable.)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this