Since everyone has covered the code, I'm going to give my advice on something else I noticed in the OP. I would warn against learning from SAMS Teach Yourself C++ in 21 Days and any book for that matter that claims to teach you <x language> in <x amount of time>. I would also recommend Code::Blocks ( http://codeblocks.org/ ) or MSVC over Dev-C++.The reason I don't recommend books that have time limits in the title or "for DUMMIES" or "Complete idiots guide" is because they are designed to "simplify things" and in the process may forget minute details that could give the reader that "AHA!" moment for understanding the language. Books like that also have a history of teaching poor or bad practices or never pointing out why some methods they teach should be avoided.
I always recommend this list and my reasoning:
1) Programming: Principles and Practice Using C++ 2nd Edition
Is a book designed to help you learn to program (if you have never programmed before) using C++ as a tool. It is also the intro course book for several degrees at Texas A&M University. Not to mention it is written by Bjarne Stroustrup himself.
2) C++ Primer 5th Edition
The usual recommendation for Beginner C++, but that phrase is a little misleading. It isn't a book for someone who as never programmed, but rather a book for a programmer who is experienced in another language and looking to learn C++ now. It covers C++ more in-depth.
3) The C++ Standard Library: A Tutorial and Reference
Covers the standard library in-depth.
4) The C++ Programming Language (as a reference)
I recommend this purely as a reference book. It too is written by Bjarne Stroustrup. You can certainly read it cover to cover if you like, but it makes a better reference than a book about learning due to its technical nature.
You can't go wrong with Scott Meyers' books either:
Effective C++
More Effective C++
Effective STL
Effective Modern C++
As for coding style, most of the books touch on the coding style, and you can see a good example of a commonly used style by looking at their code samples throughout the books. As mentioned you can also sift through the ISOCPP site ( https://isocpp.org/ ) which is loaded with information.
Can't afford books? There are some tutorials on sites (some with forums to ask advice):
Tutorial: http://www.cplusplus.com/doc/tutorial/ Forum: http://www.cplusplus.com/forum/
http://www.dreamincode.net/forums/forum/48-c-tutorials/
Then, of course, there is this site to ask advice on when you are stumped.