Total Begginer C++ Tutorial

Started by
15 comments, last by demonkoryu 19 years, 6 months ago
the std libraries can include other std libraries. But that's not defined. So you shouldn't count on it. Always include the header you're going to use. That may work on your compiler (where their implementation includes 'string' in 'iostream'), but maybe not on your new learner which will be kinda confused.
[ ThumbView: Adds thumbnail support for DDS, PCX, TGA and 16 other imagetypes for Windows XP Explorer. ] [ Chocolate peanuts: Brazilian recipe for home made chocolate covered peanuts. Pure coding pleasure. ]
Advertisement
Quote:Original post by NoWhereMan
Quote:Original post by Eriond
To use string, include string :) You didn't do that in your example.


Are you taking about #include <string>?

That's not necessary here, all you need to do is:
*** Source Snippet Removed ***

It works just fine, and this tutorial is intended for complete beginers.


  • It is necessary.

  • If you are going to write a tutorial for complete beginners, make sure it is completely correct so that they don't get completely weird errors with their completely incorrect code.



But hey! Atleast you're trying. Just make sure your information is correct before publishing it, and all will be well.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

Quote:Original post by NoWhereMan
Are you taking about #include <string>?


Yes

Quote:That's not necessary here, all you need to do is:


Nothing in the C++ standard says that <iostream> has to define std::string.

Quote:It works just fine


Not on my machine.

Quote:and this tutorial is intended for complete beginers.


Which makes correctness even more important, misleading a beginner is the worst disservice you can give them.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Quote:Original post by Washu
Quote:Original post by NoWhereMan
Quote:Original post by Eriond
To use string, include string :) You didn't do that in your example.


Are you taking about #include <string>?

That's not necessary here, all you need to do is:
*** Source Snippet Removed ***

It works just fine, and this tutorial is intended for complete beginers.


  • It is necessary.

  • If you are going to write a tutorial for complete beginners, make sure it is completely correct so that they don't get completely weird errors with their completely incorrect code.



But hey! Atleast you're trying. Just make sure your information is correct before publishing it, and all will be well.


The guy obviously hasn't got a clue what he's talking about, and shouldn't be writing tutorials.

blind leading the blind.
Quote:Original post by elementary
Quote:Original post by Washu
Quote:Original post by NoWhereMan
Quote:Original post by Eriond
To use string, include string :) You didn't do that in your example.


Are you taking about #include <string>?

That's not necessary here, all you need to do is:
*** Source Snippet Removed ***

It works just fine, and this tutorial is intended for complete beginers.


  • It is necessary.

  • If you are going to write a tutorial for complete beginners, make sure it is completely correct so that they don't get completely weird errors with their completely incorrect code.



But hey! Atleast you're trying. Just make sure your information is correct before publishing it, and all will be well.


The guy obviously hasn't got a clue what he's talking about, and shouldn't be writting tutorials.

blind leading the blind.

While this may be true, you are none the less trolling a thread. Which is an even worse offense on these boards. Please try and keep it to a minimum.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

Sorry, my bad, I have only been working with the Dev-C++ IDE, and have not used VS6.

I will try to be more precise before releasing a tutorial of any kind.
_______________________________________________________________________________________He's a real no where man, sitting in his no where land, making all his no where plans for nobody...
Quote:Original post by GroZZleR
{ } are called braces, curly braces or curly brackets.
[ ] are called brackets.
( ) are called parenthesis.


Hey thanks, finally explained!

Nowhereman: Keep it going! I think its a pretty good intro.
Quote:Another common command that you must tell the computer is the "using namespace std;" command.

Needs more explanation.

Thermo

This topic is closed to new replies.

Advertisement