C++ Functions

C++ Function is a piece of code that performs specific tasks. Functions can run multiple times by calling them in code. They may or may not have a return value. Any C++ code must have at least one function. In C++ programming language functions provide code reusability. There are two types of functions in C++ … Read more

C++ Structures

C++ Structures store variables having different data types. For instance, n C++ programming language, user sometimes faces a situation where he needs to store a collection of various types of data in a single entity. Arrays provide the functionality to store data having same data types. Whereas for saving data of different data types, Structures … Read more

C++ Pointers

C++ Pointers are variables that store memory address of another variable. In C++ programming language, each variable that user declares, has a specific memory allocation. To access these memory locations programmers user pointers. The syntax for declaring a pointer is: Asterisk sign (*) represents the pointers. It is called the Deference operator. Here pointer_type is … Read more

C++ Constants

Constants C++ Constants are actually like fixed variables. Their value is declared in the beginning and cannot be altered afterward. In the C++ programming language, Constants are basically fixed values. These values are unchangeable throughout the program. These are also called Literals. C++ Constants Data types C++ constants have the same data types as C++ … Read more

C++ References

C++ References refer to another variable. Reference variables act as reference to already existing variables. This means that a single variable can be called in two ways. One way is calling it by its own name and in second way calling by its reference variable. Create C++ Reference & operator is used to create reference … Read more

C++ Overview

This tutorial has been prepared for all types of learners whether they are a novice and want to start from scratch or for those who want to learn advanced concepts in C++. In this tutorial, it has been considered that the reader has knowledge about computer programs and programming languages.  If you are not aware … Read more

C++ Code Structure

For understanding the structure of the C++ code, first consider the following snapshot of the code. Output: Hello World The code consists of seven lines.  Each line of the code is called statement of expression. Each C++ statement ends with semicolon(;). We explain each statement of the code. #include <iostream.h>; The first line is #include <iostream.h>;. … Read more

C++ Loops

Loops Quite often there comes a situation when a programmer needs to repeat a piece of code multiple times. Why is Repetition Needed? Repetition provides following purposes: Duplication Taking input, sum, and average of multiple numbers using a limited number of variables For example, to add five numbers we may have two different algorithms: Declare … Read more