I have been noticing that lately there have been quite a few forum posts asking for the best place to learn c++. I just want to recommend this website: http://www.thenewboston.com/
Truly, this is one of the best places to learn the basics of c++ (or any other programming language for that matter) in funny and simple videos which get straight to the point. This guy also teaches many other program languages such as java and objective-c as well as programs such as 3DS max for game development.
Going to bump this for other members, Bucky was a huge help and if you enjoy watchign videos, he has a whole series devoted to java and c++ on youtube. I haven't been there since last year but I'm sure it's improved a ton.
Actually, the reason is quite simple. If this is the guy I'm thinking of, then he advocates a few extremely poor C++ coding practices, as well as a mentality of "you don't really need to know how something does something". This is a type of attitude that ill-befalls C++ programmers.
Yes, he's easy to follow. Yes, he's fun. But I would never recommend him as a resource for learning C++. I don't know about the other things he teaches.
Not to make a argument, but the three books I have read on C++ does what you just said (C++ for dummies 09', Through Game Development 3rd edition, and C++ Primer 5th). Of out of the 3 books, 2 tell to use System("pause") and whatnot (one told how to pause the screen by using a .dll file). And detail is something a book lacks in the start too. There don't go in detail of namespaces, or headers, or even return. The simply say "return makes your program exit if in the main, or "you have to use the std namespace or you cant use the basic functions of iostream". At least, in those 3 books they don't.
I don't see any difference between it besides, after a few hundred pages, the book actually goes into great detail about those subjects.
Once again, I might of skipped a few pages. Who knows.
I'm confused. Why is std::system("pause"); a bad thing? Isn't it just the C++ Standard (or simplistic) form of doing cout << "Press a key to continue..." << endl; char ch; cin >> ch; I have used both methods or just opened a console window to see the output.
It's not "standard C++" and it's not part of the std namepsace. It's defined in <stdlib.h>. It's a call to the Operating System. It's platform dependent. It can be a gateway for malicious code. Why go through that trouble when all you could do instead is wait for a newline or for the user to press any key?
Well that book just got trashed. One of my reference books had it as std::system(); in cstdlib for Standard C++. I don't have any good reference books. Honestly there are none as it seems that the ones that aren't Computer Science course books end up teaching bad practices (like system("pause"); ). I use it sparingly on my console stuff just to see the output. Otherwise I just open a console window and run the file from there.
Come to think of it I haven't used it in a few years now. If I want to hold the app I do the char ch; cin >> ch; method or have a console window open and set to the directory I'm working in.
Your code will compile just fine if you #include <cstdlib> and don't put std:: in front of it, even if you're not usingnamespace std;, so it's only kind of in the std namespace because it's part of C. I will retract and call it "standard C++", but it shouldn't be in such wide, "standard" usage.