A Roadmap to C++
Tags: cpp, beginners, codenewbie, computerscience
Published: 2022-08-07 16:28:19

### By Suvendu Panda

Hey there. College lecturers going real fast in C++ and you can't keep up with it? Well, we got you. 

To be honest, the shortcut to being fast and fluent in C++ is……..well, there is no shortcut except to practice and practice more.

![Practice C++](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t220gi6off8f6oxndje3.png)
 

But I can help you get started with the basics of C++.

## Intro:

I hope you have an IDE(integrated development environment) installed on your laptop like Visual Studio Code, ubuntu, or any other compiler. If not, there are a lot of [online compilers](https://www.onlinegdb.com/) that can help you get what you want. 

![IDEs for C++](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3qati07nq17q9plk9yy3.png)
 

## What do we want next? 

We need to know the basics of C++. Open up your compiler and type in the basic “boring” code. The code goes like this:

```
#include<iostream>
using namespace std;
int main()
{
cout<<” HELLO WORLD ”;
return 0;
}
```

Cannot understand any part of the program? No issues. 

Just run the program and be familiar with your compiler. Check how the output screen is. Save the file correctly, and be sure to name it `MYFIRSTPROGRAM`. 

Why? Because that is **the law**. 

Next, we will learn what parts of this program do what.


##The first line of the program: `#include <iostream>`.

`<iostream>` is a header file required to add a bunch of already defined functions to the program. 


`#include` is used to direct the preprocessor to add the header file. There are a bunch of header files that we shall learn later, but the basics first.


## What does `int main()` do?  

`int` stands for integer which is a return type, or what kind of value the function will return after it has been executed. 

`main()` is a function, a predefined function, that does not need a declaration. Anything in between **{}** parenthesis is called _the body of the program_, which is important because that is where the basic coding goes. That is where you tell the program what to do and what not to do. 

In this case, we have a 

```
cout<<"HELLO WORLD";
return 0; 
```

in the body. 

##What is "cout"? 

Basically, it is an object that is used to print the outputs we want to show in the terminal. The "<<" is the right shift operator which is followed just after a cout. Anything we want to print, like a text line, suppose your name, goes between " ". 


For example,` cout<<"HEY READER";`.

To end a line we need to have a ";" at the end. That is the way how the compiler understands, _oh, okay this is the end of the line, cool._

##The last part of the program, the `return 0;`

Remember how we added `int `before the main function. This `return 0` is used to return a "0" or null value at the end of the program.

There you have it, folks, you have understood the basics of the basics to C++. To learn even further, I would suggest you some of the websites or YouTube tutorials that can help you get better at it.


Here is a list of the YouTube channels that will help you get better at coding:

- CodeBeauty

![CodeBeauty YouTube channel](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xx1yvi1fy0icadl6wm5d.png)
 
- freeCodeCamp.org

![freeCodeCamp.org YouTube channel](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qazt8xi0sonfp34ekew8.png)

- thenewboston

![thenewboston YouTube channel](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/51l99njl21ewva4rn3ma.png)
 
and many websites that can help you get going with the basics.

- w3schools

![w3schools.com](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gmjdr435g6rf8fdogyj5.png)
 

- programiz

![programiz.com](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l0b1p3z7o1srn60eh43x.png)
 

- tutorialspoint

![tutorialspoint](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/of5uv2x3rws0si401r4o.png)
 
Once you are good with the basics I would suggest you go through [some C++ projects](https://dev.to/crazycodigo/c-projects-from-beginners-to-advanced-46j6) so that you will be fluent with them.

## THINGS TO KEEP IN MIND:

- If you are learning with the help of YouTube tutorials, **pause and type the codes by yourself**, because there are many times when you face problems while writing the program on your own.


- **Keep taking notes.** Make a rough copy or a digital note where you can include all the things that are required. That may be definitions, confusing codes, or syntax.


- Note down **where you are making mistakes**, and keep a track of them.


- **Practice** as much as you can.


Cya!
~ Suvendu