Static Member Function and Variables in C++

In a C++ programming we can create static function and variable by using the “static” keyword. Static Variables  In C++ programming we can create a static variable by placing the “static” keyword before the variable declaration. Once a variables declared as static, only one copy of that variable is created for the whole class.  When … Read more

Categories C++

Inline Function in C++

In a C++ language  An inline function is similar to macros. Inline function is also called as open subroutine because their code is replaced at the place of function call in the caller function.  In a C++programming  normal  function  are known as closed  subroutine because when such function are called ,the control passed to the … Read more

Categories C++

Member functions in C++

In a C++,  we can use the function within the classes. These functions are called as a member function. It can be public ,private & protected. Public member function: in a below program we have created a public function which can be accessed from outside of class.

Output

Private member function:  in a … Read more

Categories C++

Access Specifiers in C++

In a C++ language there are three types of access specifiers . They are: public private and protected. Public: A public data can be accessed by out side of the code in which it is defined . Private : A private data can not be accessed by outside of the code in which it is … Read more

Categories C++

Class & Object in C++

Class:  A class is a user defined data type which contains the data members and member function. A class forms the basis for object oriented programming.  It describes the shape and nature of the object . Any concept that we want to implement in oop’s must be encapsulated in class. The internal data of the … Read more

Categories C++

Pointers in C++

In  a  C++ programming language, variable is used to hole the value & this variable stored in a memory.  Each variable has a address to identify where these variables actually stored in a memory.    In a C++  programming language, pointer is a variable which can hold the address of another variable.    Accessing Address of … Read more

Categories C++

Structures in C++

There are various types of data type such as int, char float etc. For example: int  i;      here variable i can store only data of integer typechar c;   here variable c can store only data of character typefloat  f; here variable f can store only data of floting-point type Variable of each data … Read more

Categories C++

Looping Statements in C++

In a programming often a situation may comes where we want to  execute the set of code again and again. Loop has a ability to repeat set of statement until a condition to be satisfied or a particular number of times. There are following types of  loop in C++  language: In a C++ programming language … Read more

Categories C++

Switch statements in C++

“switch” is a case control structure.  It contains case and default values. “switch” statement takes a value as a expression for equality testing against a list of values/case. syntax for a switch statement:-

Rules of switch statement − In a “switch” statement we can have any number of case. for equality testing against a list of values/case, constant-expression for a case … Read more

Categories C++