Category: Basic Concepts

Static in C++

Static Data Members A data member of a class can be qualified as static, in which case only one instance of it exists. You would use a static data member to maintain a global value that applies to all instances of the class. Member functions can modify this value, and all other objects of the […]

Difference Between C++ Simple Variable and Structure Variable

A variable represents a location in the memory of computer. During program execution, it is used to store input data and its operations. The name of the memory location (such as variable name) remains fixed, whereas data of the variable may change several times during the program execution. A structure is a collection of related […]

Difference between Local Variable and Global Variable

A variable that is declared inside a function is called local variable. While, a variable that is declared outside of the main() function is called global variable. The following is the main difference between local and global variable. Local Variable Global Variable It’s declared inside the main() function or any other user defined function. It’s […]

What is difference between Compiler and Interpreter

A language translator program that translates the complete source code into machine code as a whole is called compiler. While, a language translator program that translates source code into machine code statement by statement is known as Interpreter. The main differences between compiler and interpreter are given below: Compiler Interpreter It provides fastest program execution. […]

Difference between Formal Parameters and Actual Parameters

A parameter is a piece of data passed to a function. If a function uses arguments then the variables must be declared in the header of function definition to receive the values. There are two types of arguments/ parameters: Formal Parameters Actual Parameters Formal Parameters The parameters used in the header of function definition are […]

Difference Between C++ Define Directive and Const Keyword

In C++, the symbolic constant can be declared in the following two ways: Using #define Using const keyword The #define Directive The “define” is a preprocessor directive that is used to define a constant identifier known as constant macro. A constant macro is an identifier, which is assigned a particular constant value. Like other preprocessor […]

Logical Operators in C++

The C++ operators that are used in logical conditions such as compound expressions are called logical operators. Two or more relational expressions are combined using these operators. In C++, there are three logical operators: Operator Symbol Sign Name AND Operator && double ampersand sign OR Operator || double pipe sign NOT Operator ! exclamation sign […]

Control Structures in C++

Control structure is a statement that is used to control the flow of execution in aprogram. These control structures arevery helpful in implementing the programlogic. Using control structure in our program enable us to group individual instructions into a single logical unit with one entry point and one exit point.Generally, program statements are execute one […]

What is Repetition Structure in C++

Repetition structure is used to execute a statement or group of statements repeatedly as long as the given condition remains true. In this structure, the statements are executed according to the given condition. If condition true (it returns 1) then set of statements are executed that are under the given condition. After this, control transfer […]

What is Sequence Structure in C++

In a sequence structure or sequential structure, the statements of a program are executed in the same order in which they are written in the program. The statements are executed one after the other. In this structure, all statements of the program executed sequentially without skipping any statement.  An algorithm with sequence structure are as […]