Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Using namespace std

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
407
Master Cheater
Reputation: 0

Joined: 25 Oct 2007
Posts: 357

PostPosted: Wed Jan 05, 2011 1:14 am    Post subject: Using namespace std Reply with quote

Can someone tell me the difference between

Code:
using namespace std
cout << ...


and
Code:
std::cout << ...



Is it all just preference?
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Jan 05, 2011 4:47 am    Post subject: Reply with quote

nothing.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Jan 05, 2011 12:54 pm    Post subject: Reply with quote

Like Slov said, nothing. Adding the 'using namespace' for things like std just make it so you don't have to type std:: in front of anything that is part of that namespace. The functions are still exactly the same though, it is just a convenience type thing.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
NoMercy
Master Cheater
Reputation: 1

Joined: 09 Feb 2009
Posts: 289

PostPosted: Fri Jan 07, 2011 4:54 am    Post subject: Reply with quote

Some book are saying, if you use using namespace std; you do not use the namespace usefull, since it would be a global variable, you can do it better inside a function or use namespacename::

Note, this is what Bjarne Stroustrup wrote in his book.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites