Saturday, 5 August 2017

Function Overloading in CPP


Function Overloading:

If any class have multiple functions with same names but different parameters then they are said to be overloaded. Function overloading allows you to use the same name for different functions, to perform, either same or different functions in the same class.

Function overloading is usually used to enhance the readability of the program. If you have to perform one single operation but with different number or types of arguments, then you can simply overload the function.



Wednesday, 12 July 2017

Types of Member Functions


Types of Member Functions:

We already know what member functions are and what they do. Now let’s study some special member functions present in the class. Following are different types of Member functions,

1.     Simple functions

2.    Static functions

3.    Const functions

4.    Inline functions

5.    Friend functions


Member Functions in Classes


Member Functions in Classes:

Member functions are the functions, which have their declaration inside the class definition and works on the data members of the class. The definition of member functions can be inside or outside the definition of class.

If the member function is defined inside the class definition it can be defined directly, but if its defined outside the class, then we have to use the scope resolution :: operator along with class name along with function name.

Accessing Data Members of Class


Accessing Data Members of Class:

Accessing a data member depends solely on the access control of that data member. If it’s public, then the data member can be easily accessed using the direct member access (.) operator with the object of that class.

Defining Class and Declaring Objects


Defining Class and Declaring Objects:

When we define any class, we are not defining any data, we just define a structure or a blueprint, as to what the object of that class type will contain and what operations can be performed on that object.

Access Specifiers in C++


Access Control in Classes:

Now before studying how to define class and its objects, let’s first quickly learn what access specifiers are.

Access specifiers in C++ class defines the access control rules. C++ has 3 new keywords introduced, namely,

1.     Public

2.    Private

3.    Protected

Classes and Objects in CPP


Introduction to Classes and Objects:

The classes are the most important feature of C++ that leads to Object Oriented programming. Class is a user defined data type, which holds its own data members and member functions, which can be accessed and used by creating instance of that class.

The variables inside class definition are called as data members and the functions are called member functions.

Sunday, 25 June 2017

Variables in C++


What are Variables?

Variable are used in C++, where we need storage for any value, which will change in program. Variable can be declared in multiple ways each with different memory requirements and functioning. Variable is the name of memory location allocated by the compiler depending upon the data type of the variable.

Friday, 23 June 2017

Data Types in C++



They are used to define type of variables and contents used. Data types define the way you use storage in the programs you write. Data types can be built in or abstract.

Built in Data Types:
These are the data types which are predefined and are wired directly into the compiler. eg: int, char etc.

User defined or Abstract data types:
These are the type, that user creates as a class. In C++ these are classes where as in C it was implemented by structures.

Wednesday, 31 May 2017

C++ Basics and Structure


Ø Basics of C++:

In this section we will cover the basics of C++, it will include the syntax, variable, operators, loop types, pointers, references and information about other requirements of a C++ program. You will come across lot of terms that you have already studied in C language.

Ø Syntax and Structure of C++ program:

Here we will discuss one simple and basic C++ program to print "Hello this is C++" and its structure in parts with details and uses.

Sunday, 26 March 2017

Introduction to C++


ð Introduction to C++


C++, as we all know is an extension to C language and was developed by Bjarne stroustrup at bell labs. C++ is an intermediate level language, as it comprises a confirmation of both high level and low level language features. C++ is a statically typed, free form, multiparadigam, compiled general-purpose language.

Tuesday, 21 March 2017

Introduction to Pointers

Pointers are variables that hold address of another variable of same data type.

Pointers are one of the most distinct and exciting features of C language. It provides power and flexibility to the language. Although pointer may appear little confusing and complicated in the beginning, but trust me its a powerful tool and handy to use once its mastered.

Types of Function calls in C

Functions are called by their names. If the function is without argument, it can be called directly using its name. But for functions with arguments, we have two ways to call them,

  1. Call by Value

  1. Call by Reference

Functions in c

A function is a block of code that performs a particular task. There are times when we need to write a particular block of code for more than once in our program. This may lead to bugs and irritation for the programmer. C language provides an approach in which you need to declare and define a group of statements once and that can be called and used whenever required. This saves both time and space.
C functions can be classified into two categories,
  1. Library functions
  2. User-defined functions

Wednesday, 8 February 2017

Introduction to Structure


Structure is a user-defined data type in C which allows you to combine different data types to store a particular type of record. Structure helps to construct a complex data type in more meaningful way. It is somewhat similar to an Array. The only difference is that array is used to store collection of similar data types while structure can store collection of any type of data.

Structure is used to represent a record. Suppose you want to store record of Student which consists of student name, address, roll number and age. You can define a structure to hold this information.

Tuesday, 31 January 2017

Arrays in C Language


In C language, arrays are referred to as structured data types. An array is defined as finite ordered collection of homogeneous data, stored in contiguous memory locations.
Here the words:
·         finite means data range must be defined.
·         ordered means data must be stored in continuous memory addresses.
·         homogeneous means data must be of similar data type.

Monday, 30 January 2017

How to use Loops in C Lanugage


In any programming language, loops are used to execute a set of statements repeatedly until a particular condition is satisfied.

A sequence of statements are executed until a specified condition is true. This sequence of statements to be executed is kept inside the curly braces { } known as the Loop body. After every execution of loop body, condition is verified, and if it is found to be true the loop body is executed again. When the condition check returns false, the loop body is not executed.

Switch Statement


Switch statement is used to solve multiple option type problems for menu like program, where one value is associated with each option. The expression in switch case evaluates to return an integral value, which is then compared to the values in different cases, where it matches that block of code is executed, if there is no match then default block is executed. The general form of switch statement is:

Sunday, 29 January 2017

Factorial of a Number- C Program

In this video tutorial, I've explained how you can write a C Program for Finding out the Factorial of any number by using the looping method. Below is the video of Factorial of any Number in C.


Decision making in C

Decision making is about deciding the order of execution of statements based on certain conditions or repeat a group of statements until certain specified conditions are met. C language handles decision-making by supporting the following statements,
·         if statement
·         switch statement
·         conditional operator statement
·         goto statement

Variables in C Language

A variable is a name that may be used to store a data value. Unlike constant, variables are changeable, we can change value of a variable during execution of a program. A programmer can choose a meaningful variable name. Example: average, height, age, total etc.

Addition of Two Numbers - C Program

In this video, you'll see how to use the (+) Operator in C Program for performing Addition of Two Numbers. By using the same code and changing the Operator Symbol, you can perform other operations like Minus (-), Multiply (*), Divide (/) & Remainder (%).


If you like this video, Plz Share it and Subscribe to my YouTube Channel for more video tutorials. 

Data types in C Language

Data types specify how we enter data into our programs and what type of data we enter. C language has some predefined set of data types to handle various kinds of data that we use in our program. These data types have different storage capacities.
C language supports 2 different type of data types,

Sunday, 15 January 2017

Operators in C Language


C language supports a rich set of built-in operators. An operator is a symbol that tells the compiler to perform certain mathematical or logical manipulations. Operators are used in program to manipulate data and variables.

C operators can be classified into following types:

·         Arithmetic operators
·         Relation operators
·         Logical operators
·         Bitwise operators
·         Assignment operators
·         Conditional operators
·         Special operators