Learning C++ as a beginner

Chirag Jain

Chirag Jain

Incoming SDE Intern @ Microsoft

This blog, is for those who are not familiar with the C programming language and want to learn C++, mainly for competitive programming.

Tutorial

Read and try the various syntax given in the following sections, from this tutorial :

  • C++ Basic syntax
  • C++ Comments
  • C++ Data Types
  • C++ Variable Types
  • C++ Operators
  • C++ Loop Types
  • C++ Decision Making
  • C++ Arrays
  • C++ Strings
  • C++ Functions

If sufficient time is available, you may also want to read the following sections :

  • C++ Pointers
  • C++ References
  • C++ Structures

Practise

For windows users

To practice writing programs in windows, we would suggest you to download CodeBlocks IDE. To learn how to download codeblocks, watch this video ( Upto 4:30 minute )

To learn to create, compile and run C++ files :

  1. Open Codeblocks
  2. File โ‡’ New โ‡’ Empty File.
  3. Enter your code.
  4. Save the file as "Hello.cpp" (or any other name) in your some directory.
  5. Select "Build" menu โ‡’ Build (or press Ctrl-F9).
  6. Run: Select "Build" menu โ‡’ Run (or press Ctrl-F10).

For linux users

To practice writing programs, we would suggest you to download Geany IDE. To learn how to download and setup geany, watch this video

To learn to create, compile and run C++ files :

  1. Open Geany
  2. File โ‡’ New โ‡’ Empty File.
  3. Enter your code.
  4. Save the file as "Hello.cpp" (or any other name) in your some directory.
  5. Select "Build" menu โ‡’ Build (or press Ctrl-F9).
  6. Run: Select "Build" menu โ‡’ Execute (or press Ctrl-F5).