Wednesday, 12 July 2017

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.