Learning programming definitely isn't an overnight thing, and takes a large amount of hard work and dedication (especially with C++). This guide will help you through the process.
Steps
-
Learn about C++'s history. The best way to start programming a language is to learn its roots. Even though you may not understand everything that you read, some of these pages will introduce you to important terms that will come up later (such as "Object-Oriented Programming").
-
Install a C++ compiler (and possible IDE). A compiler is required for programming in C++, because the actual source code has to be compiled into a file that your computer can run. If you are using Windows a good option would be Visual C++ 2010 Express, or if your using Linux a good one is Geany. Both come with an IDE (integrated development environment) built in, which can make the process of writing source code easier. (NOTE: Many people online will recommend that you use the Bloodshed Dev-C++ IDE and compiler. DON'T. It has not been updated in 5 years and has pages and pages of known bugs, listed here: http://sourceforge.net/p/dev-cpp/bugs/ )
- Learn how to use your IDE efficiently. Some IDEs that are out there have their own individual quirks that could get in the way down the road, so it would be beneficial to read through or keep a reference for the different options and settings of your IDE.
Advertisement -
Choose a tutorial or two to start learning C++. This step is, along with the compiler, one of the most important steps of all. There are a few things that you have to make sure of during this step. First of all, make sure the guide is written for complete newbies to programming, as those are the most thorough in their descriptions. Next, make sure that the code in the tutorial follows the C++03 standard or even the new C++11 (still not standardized, so beware of compiler issues), because modern compilers will have trouble compiling outdated code, or will just reject it altogether. A few good ones are c programming.com's C++ tutorial and the tutorial at www.cplusplus.com/doc/tutorial/.
-
Try out each new concept. An important part of programming is not only reading about the different concepts, but using them in your own code. Copy-pasting the code into your IDE will only go so far. It is much more beneficial to type out each example and even try creating your own program ideas that use the concept being taught to maximize the amount of information retained.
-
Learn from other developers. One of the best things about programming is that no matter what level of skill you have in programming, there will always be source code readily available that is at that same level or one step above you. A good way to learn from more complicated source code is to read through until you reach a point which you don't understand, then try to work it out in your head; if you don't know a certain part of the code, read about it in your tutorial or reference material until you do.EXPERT TIPTechnologistTyrone Showers is a Technologist and the Co-owner of Taliferro Group, an IT consulting company based in Seattle, Washington. With over 35 years of professional experience, he specializes in API Design, e-Commerce, Operational Efficiency, and website development. He has a B.S. in Computer Science from DeVry Institute of Technology.
Learning C++ requires grasping both programming concepts and practical compiler usage. Start simple when beginning, then progressively take on more complex coding tasks. Resources like Visual Studio can aid quick learning. Understanding design patterns helps, too. Writing small practical programs and reaching out online with questions along the way will help get better at problem solving in C++. Sticking with it is key to mastering it.
-
Work through problems using the concepts you have learned. The absolute best way to retain what you learn isn't just writing out source code examples, but actually accomplishing a set task with them. Both c programming.com and Project Euler have good problems that you could try solving to apply concepts in real-life situations. If you absolutely can't create an algorithm for a problem, then as a last resort check online for one done by someone else and learn from it. What's the use of solving a problem if you don't learn from the result?
-
Help others who need help. Now that you have learned about C++, you should start helping other newbies online with their problems and get them started on the same journey you had! Don't get frustrated if the person who asked you for help doesn't want to listen to your advice: someone else could learn from the answer you provide even if the original poster didn't.
Community Q&A
-
QuestionHow long does it take to learn C++?Community AnswerIt likely differs from person to person, but it could take a few years to learn it correctly and thoroughly.
-
QuestionCan I earn money by just learning C+?Community AnswerYes, you can earn money just by learning C++. Many people do it.
-
QuestionHow do I study C++ on my phone?TheRedEmerald MusicCommunity AnswerThere's a great app called SoloLearn that I used to learn programming languages such as C++.
Video
Tips
- Don't get frustrated! Programming can be confusing at some points, but that definitely doesn't mean you should just throw away all your progress and quit! If a certain guide does a bad job at explaining a topic, try reading another one on the subject; it may not be you that's the problem!Thanks
- If you get errors while compiling, re-read the source code again and see if you can find errors. Although the errors themselves can seem cryptic, they are trying to tell you what is wrong, so see if you can learn anything about the error from them.Thanks
- Go at your own pace.Thanks
Warnings
- C and C++ are very low-level programming languages, meaning you have the possibility of crashing your computer with faulty code or with purposefully malicious programs! Make sure NEVER to compile and run programs that have "#include <windows.h>" in them unless you're ABSOLUTELY CERTAIN you know what you are doing, and even if you do know what you are doing, try to avoid it at all costs.Thanks
- Lots of Antivirus will think whatever you make is a virus! Be sure to add your program to exclusions and possibly turn off your Antivirus so your program doesn't get deleted!Thanks
- Make sure your compiler and tutorial are up-to-date! Outdated compilers can lead to valid source code not compiling or weird errors at run-time. The same can be said about tutorials.Thanks
Expert Interview
Thanks for reading our article! If you’d like to learn more about programming, check out our in-depth interview with Tyrone Showers .
About This Article
Reader Success Stories
- "I am only a 13 years boy, and my dream is to work for Ubisoft, so I decided to learn coding C++ because it is the language used in video games. I didn't know where to start, but after reading this article I know everything. Thank you so much!" ..." more