Fundamental Programming and Algorithm Lessons: C++

 C++

1)Libraries

    We use commands in libraries. Every command are in a library. We import libraries to computers like this:
#include<name>
You type the name of the library between < and >.

2)Main Function

    Computers run the code but they must know where are the codes? We show it by functions. The computer first runs the main function. We type the main function like this:
void main(){codes}

3)Standart Library

    C++ have some command and you generally use them. But when you use them, you must show that to the computer: I want to use x command in the standard library. You must focus on the library or else the computer can not find the command. We use this:
std::command
     If you don't want to use std:: all time you can type using namespace std; but programmers don't advise this because computers may mix the command.

3)Syntax

    You must care about syntax rules in programming or else complier will return errors. The most important syntax rules:

  •    Comments: We can add comments outside the code. We type "//" to explain. If you need to add a comment more than one line, you can add /* beginning of the comment and */ end of comment
  •     Strings: We type " to head of text and end of the text.
  •     Functions:We type { and } for codes in a function.
  •     Process: We type ; to the end all codes.
I am going to mention these again. I did not add details about codes.  I hope they can be enough for you.

4)Example



Comments