C++ Storage Classes

The C++ variables are divided into 4 major storage classes which can change the scope/lifetime of the variables. In this article, you will learn about C++ storage classes with examples. The C++ storage classes are the same as the C programming language. Here is the list of storage classes. Automatic Storage class Register Storage Static … Read more

C++ Global vs. Local Variable

The C++ programming language have scope set for variables depending on where it is declared. You can use variable with global scope anywhere in the program. The variable with local scope has limited scope. In this article, we will understand the difference between them and how to use them. Global Variable A global variable is … Read more

C++ Function Types

The C++ functions are of many types, but we broadly classify them into four categories – functions that return a value, function that does not return a value, function with parameters, and function without parameter. You many find functions that fall under more than one categories. In this article, you will learn about function each … Read more

C++ Functions

The C++ functions are user-defined named block of code that performs a specific task. The function takes parameter or no parameters, it may return a value or not return anything. Every function has a type that indicates the return type of that function. The main() is a function in C++ program and there could only … Read more

C++ Breaking Control Statements

There are three ways to break a control statement – break, continue and goto statements. In this article, you will learn about these statements in detail. A control statement executes all statements within its own block, but sometimes it wants to stop and exit the block. In these cases, we introduce a breaking statement. Three … Read more

C++ Do-While Loop

The do-while is another type of loop supported by C++ language. In the case of while loop and for loop – three expressions are compulsory. This is also true for do-while, but in a different way. do-while Loop Structure The do part allow the code block to execute first and then the while part perform … Read more

C++ while Loop

A while loop is another kind of loop control structure. The loop has initial condition and a test condition to pass before the actual loop body starts. The loop is incremented or decremented inside of the loop body. The general structure of while loop is given below. The initial expression is a simple assignment where … Read more

C++ switch-case Statements

The switch-case statements are similar to if-else-if construct – a multiple decision maker. It allows you to choose a constant (a switch) that matches with a case (constant) and executes all statements that follow the matched case. The main difference between if-else-if construct and switch-case is that the if-else-if uses multiple conditions at each level. … Read more

C++ if-else Statements

The if-else statement is a conditional statement with an optional else. The if statement executes a block of statements is the condition is true, but does not do anything when condition is false. The if-else block contains code for both true and false conditions. Each of the block in if-else construct will be enclosed using … Read more

C++ If Statements

The C++ If statement is a conditional statement. The program executes a block of code only if condition is satisfied or true. This changes the flow of C++ program. The program executes only required blocks and ignore others. There are two ways to write an if statement. With curly braces Write without curly braces( { … Read more

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.