CPP OOPs Concepts

CPP introduced the features of OOPs Concept, i.e, CPP is an object-oriented programming language which uses classes and objects for computations. However, it is not considered to be truly object-oriented programming language. Advantages of Object Oriented Programming Language: Development and maintenance of is easier than the procedural programming. Easy to solve the real world problems … Read more

Categories CPP

CPP Pointers

CPP pointers can be defined as a variable, pointing towards the address of a value. Syntax: Data_type *variable_Name; CPP Pointer to Pointer: When a pointer refers to the address of another pointer, it is called as Pointer to Pointer in CPP. Syntax: Data_type **variable_Name; Pointer Arithmetic in C: CPP also facilitates Arithmetic operations with Pointers. … Read more

Categories CPP

CPP Multidimensional Arrays

A multidimensional array is an array containing two, three, four, five, or more arrays. The increasing number of dimensions, increases the code complexity for the developers. The most popular arrays are single, two and three dimensional arrays. Two dimensional Arrays: A two-dimensional array can be defined as an array of arrays that needs two indices … Read more

Categories CPP

CPP Array to Function

Arguments are the variables, inside the parentheses, after the function name which is used to pass informations to functions. Beside passing variables and pointers, arrays can also be passed as a function parameter or argument. Syntax: Return_type functionName (Data_type array Name[]) {     code to be executed; } Example: #include <iostream.h> using namespace std;   … Read more

Categories CPP

CPP Arrays

An array is a single variable which can store multiple values at a time. Thus, CPP array is used to hold many values under a single name. These values can be accessed then by referring to their index number. There are mainly two types of arrays: 1D array and multidimensional array. Syntax: data_type arrayName [arraySize]; … Read more

Categories CPP

CPP Storage Classes

A Storage class in CPP represents the scope of a variable within the program. The storage classes in CPP are discussed below:   Storage Classes Storage Place Default Value Scope Life-time Features auto RAM Garbage Local Within function Default storage class. extern RAM 0 Global Till the end of main program Visible to all the … Read more

Categories CPP

Recursion in CPP

When a function calls itself within its function block, it is called as self calling by a function. This whole process of self calling by a function is often termed as Recursion. Recursion is used to create a loop like behavior using a function and without using loop statements. Syntax: Return_type function_Name(parameters) { code to … Read more

Categories CPP

CPP Call: Value & Reference

Calling a function in CPP and passing values to that function can be done in two ways: Call by Value Call by Reference   Call by Value Call by Reference Original value of the function parameter is not modified. Original value of the function parameter is modified. In this method, we pass a copy of … Read more

Categories CPP

CPP Functions

A function is a piece of code that can be used repeatedly in a CPP program. A function is mainly of two types: Built in Functions; which are already defined in CPP Library. User Defined Functions; which are created and defined by users.   Syntax: Return_type functionName(parameters) {     code to be executed; }   … Read more

Categories CPP

CPP Comments

CPP comments are used to give a brief description about any specific line of code or about a module in the code to make the code more user-friendly. CPP Comments can be of two types: Single line Comments Multi line Comments   Single Line Comments: Single line comments can be used for commenting a line … Read more

Categories CPP