Poll: C++ or Python?
You do not have permission to vote in this poll.
Python
28.57%
8 28.57%
C++
71.43%
20 71.43%
Total 28 vote(s) 100%
* You voted for this item. [Show Results]

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C++ Vs Python?
#13
(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.
[Image: sig.php]
The little boat gently drifted across the pond exactly the way a bowling ball wouldn't.
Reply


Messages In This Thread
C++ Vs Python? - by nevets04 - 11-01-2009, 05:39 PM
RE: C++ Vs Python? - by Gaijin - 11-01-2009, 05:46 PM
RE: C++ Vs Python? - by L0iz - 11-02-2009, 11:00 AM
RE: C++ Vs Python? - by Etheryte - 11-02-2009, 11:40 AM
RE: C++ Vs Python? - by bsdpunk - 11-02-2009, 12:04 PM
RE: C++ Vs Python? - by Fallen - 04-05-2010, 06:45 PM
RE: C++ Vs Python? - by LOL - 11-02-2009, 12:25 PM
RE: C++ Vs Python? - by MrD. - 11-02-2009, 03:26 PM
RE: C++ Vs Python? - by Yoshi - 11-03-2009, 02:02 AM
RE: C++ Vs Python? - by uber1337 - 03-29-2010, 06:28 PM
RE: C++ Vs Python? - by J4P4NM4N - 11-09-2009, 06:31 PM
RE: C++ Vs Python? - by nevets04 - 11-09-2009, 08:38 PM
RE: C++ Vs Python? - by J4P4NM4N - 11-09-2009, 09:46 PM
RE: C++ Vs Python? - by Psycho - 11-28-2009, 05:06 AM
RE: C++ Vs Python? - by Socrates - 11-10-2009, 05:43 AM
RE: C++ Vs Python? - by MrD. - 11-10-2009, 06:50 PM
RE: C++ Vs Python? - by Brainless Control - 11-21-2009, 07:21 AM
RE: C++ Vs Python? - by Sagittarius - 12-10-2009, 11:51 PM
RE: C++ Vs Python? - by nextlive - 02-04-2010, 09:32 AM
RE: C++ Vs Python? - by ELY_M - 02-12-2010, 11:05 AM
RE: C++ Vs Python? - by TheLifelessOne - 02-12-2010, 04:31 PM
RE: C++ Vs Python? - by SouR'D - 02-14-2010, 05:30 AM
RE: C++ Vs Python? - by Fallacy - 03-10-2010, 11:12 PM
RE: C++ Vs Python? - by uber1337 - 03-11-2010, 06:32 PM
RE: C++ Vs Python? - by Fallacy - 03-11-2010, 07:06 PM
RE: C++ Vs Python? - by nevets04 - 03-11-2010, 08:53 PM
RE: C++ Vs Python? - by Fallacy - 03-11-2010, 09:33 PM
RE: C++ Vs Python? - by uber1337 - 03-12-2010, 01:43 PM
RE: C++ Vs Python? - by Unfaithful - 03-30-2010, 04:46 PM
RE: C++ Vs Python? - by C!RCU!T tr0jAn ☠ - 04-06-2010, 12:18 AM
RE: C++ Vs Python? - by Detective RooTz - 04-06-2010, 12:21 AM
RE: C++ Vs Python? - by nitinrox - 04-06-2010, 09:57 AM
RE: C++ Vs Python? - by Statics - 04-06-2010, 10:40 AM
RE: C++ Vs Python? - by MrD. - 04-06-2010, 12:46 PM
RE: C++ Vs Python? - by Awesome - 04-06-2010, 02:03 PM
RE: C++ Vs Python? - by Mar0x - 04-06-2010, 09:13 PM
RE: C++ Vs Python? - by Wolskie - 04-07-2010, 10:16 PM
RE: C++ Vs Python? - by GameOver* - 04-09-2010, 04:02 AM
RE: C++ Vs Python? - by BumbleBee - 04-09-2010, 04:15 AM
RE: C++ Vs Python? - by Anubis™ - 04-09-2010, 06:32 AM
RE: C++ Vs Python? - by delme - 05-22-2010, 07:52 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  C++, C , Python Equinøx 17 3,026 04-06-2010, 12:25 AM
Last Post: Detective RooTz

Forum Jump:


Users browsing this thread: 14 Guest(s)