(11-09-2009, 06:31 PM)J4P4NM4N Wrote: Btw, I thought the main() function had to be of return type "int" as I wrote?It should, yes.
(11-09-2009, 08:38 PM)nevets04 Wrote: That would be silly to type std:: before every line...It's only before the actual use of STL, not every line as such. I rarely do "using namespace" for third-party libraries, also you should never used a "using namespace" inside a header file because of namespace pollution.
(11-09-2009, 09:46 PM)J4P4NM4N Wrote: Exactly, but you do what fits the situation; In this case, a Hello World program doesn't need to preload everything in the std library.Pre-load? I think you're confusing what "using namespace" actually does, it promotes a namespace to a global scope (essentially dissolving the namespace), there is no "pre-loading" going on since you would still only be able to access code that you have included.
(11-09-2009, 09:46 PM)J4P4NM4N Wrote: It's quicker/smaller to pick-and-choose.Well, you do generally tend to include the headers for the classes you need and not everything since that would increase compilation time. Still, "using namespace" has nothing to do with compile time.
(11-09-2009, 09:46 PM)J4P4NM4N Wrote: Generally, though, it's better to say "using namespace std;"Once again, watch out for this in header files due to namespace pollution.
The little boat gently drifted across the pond exactly the way a bowling ball wouldn't.