1 Know the C ++ Programming Language

So, a short story in the early 1970s a person named Bjarne Stroustrup began to develop the C ++ programming language which is a derivative of Language C. If Language C is a procedural language then C ++ Language comes using the concept of object-oriented programming or Object Oriented Programming.
C programming using 2 concepts:
• Data – material to be processed.
• Algorithms – processing methods.
However, the use of procedural languages ​​such as C is very inefficient, especially for making medium to high-scale software or large projects. Too many iterations, branches, and codes that we have to type. Therefore this c language was then developed to the next level into object-oriented c language, which was then called C ++.

2 Download the C ++ Compiler

Actually, you can just simply use an ordinary text editor application like notepad and then use a compiler application that is widely available on the internet. But I don’t think it’s efficient because we will be preoccupied with technical problems. I personally studied in college using DEV C ++ 5.11, then Gameloft company used IDE Visual Studio 2015 (when I asked). However, there are many vendors who have provided full software both paid and free, please download and install it first.

3 C ++ program structure

As in general, the first step we must get acquainted with the C ++ programming language. Please open your IDE program and type the following code:

And compare with the following code:

I will give you 1 minute to see the difference.
Please note that the code above is the C ++ standard code, the two codes above will display the same data but the writing is a little different.
Let’s get to know some of the syntax / coding.

4 Header and Main Program

Header is a place where we will put the existing library in C ++ into the program code. Whereas main () is our main program block.
If you see the code in the first line there is the code #include .
The ‘#’ sign is called the preprocessor directive. Preprocessor directives are commands given to compilers to do definitions, for example to include library files, and so on. If we look at the program above we will include the iostream library in the program. iostream is the header needed for input and output “activities”.
If you look at the program code above, there are:

Whereas in the first example do not use these lines of code.
So the point is to tell the compiler that we will use all functions, classes or files contained in the std namespace memory.

We don’t need to type std :: cout to print the output but just use the cout function, because we already use the std namespace;
Furthermore the main code () is a program block that functions as the body of a conduction channel or is called the main program written between the {to} code.
Following is an example of a simple c ++ program for calculating the circumference of a circle:

5 Declaring Variables and Constants

To declare a variable that is by writing the data type first then followed by the variable name. And here is an example:

Meanwhile, to declare a constant value variable by using the const function followed by the data type, variable name, and value. Example:

For those of you who need further explanation about variables and constants, please read: understanding variables and constants in programming.

Addendum: You may not use the following c ++ keyword as the name of a variable or constant identifier or you will get an error.

Here are reserved words in C ++:

6 Kinds of Comments

Comments are notes or documentation written by the programmer as a reminder or explanation when reading a line of code. In C ++ there are two signs that can be used for a comment: The first is a sign that is used for single-line comments, for single-line comments, using double slashes //. and the second sign that is used for comments more than one line. As for the comments of more than one day, use without / * … * /.

Consider the following example:
Words in a comment will not be executed by the compiler.

7 List of C ++ Programming Study Guides

Since this guide series is very long I could not possibly make it into one page. For that, here I am making a list of the contents of our guide this time.

Please start from chapter 1 or go directly to the chapter you want to learn.

CHAPTER 1: Basic Programming for C ++

In this chapter you will learn a few basic things in the C ++ programming language from basic input to operator:

Input & Output - Basic Input & Output in C ++ with cin and cout functions

Data Types - 7+ C ++ Data Types With Examples of Programs and their Scope

Operators - 10+ Types of C ++ Operators and Their Program Functions and Examples

CHAPTER 2: Control Structure

In this chapter we will begin to learn the control structure from decision making such as (if else and switch case) to looping (for and while loop).

Branching - 2+ Examples of Simple Branching Programs Using C ++

Iteration - Example of a C ++ Simple Recurrence Program and Explanation

CHAPTER 3: Advanced

In this chapter we will learn more from functions to pointers.

Function - Example of a Simple C ++ Program Using Functions & Procedures

Array - Example of a C ++ Array Program and Explanations [Case Study]

Pointers - Coming soon
0/5 (0 Reviews)


Please enter your comment!
Please enter your name here