C++

C++  is a general-purpose programming language created by Bjarne Stroustrup as an extension of the C programming language, or "C with Classes".




C++ is by far the most popular language of choice for competitive programmers across the world as it is usually faster than Java and Python, and most of the resources are available in C++. C++ also has a vast library called STL(Standard Template Library) which makes life a lot easier for competitive coders. GNU/G++ is the standard compiler for C++ and C++ 14 is the latest updated version of C++ available on online judges.

In this, we will be covering all the required material to start doing competitive programming using C++. Later we will be covering other parts of C++ such as structure, enum, classes, templates in the Data Structures and in Algorithms. After doing all these we will be moving to Standard Template Library(C++ STL). So let's start...


Basic of C++
Control Flow
In C++ programming language, all statements are executed sequentially from the top to the bottom. However, you can change the order (flow) of statements. Control flow structures allow you to alter the flow of the statements. Thus, you can develop complex programs that depict real-world situations. In C++, you can alter the flow of statements in the following ways.
  • You can repeat a set of statements a specified number of times using for, while, do-while looping statement.
  • You can check if a condition is true or false. Based on the result, you can execute a statement of a set of statements using if, if-else, if-else-if.
Functions in C++
A function is a block of code that only runs when it is called. You can pass data, known as parameters, into a function. Functions are used to perform certain actions, and they are important for reusing code (Define the code once and use it many times).
Arrays
Arrays are used to store multiple values in a single variable, instead of declaring separate variables for each value.
Pointers
pointer, however, is a variable that stores the memory address as its value. 
A pointer variable points to a data type (like int or string) of the same type, and is created with the operator*. The address of the variable you're working with is assigned to the pointer
If you have some content OR material related to this OR find any error then do share them through the comment section for which we will be thankful to you.

Thank You
With 💙 by CODELABS3277

Comments