Learn C plus plus

C++ : Type Conversions

We know that when constants and variables of different types are mixed in an expression, C applies automatic type conversion to the operands as per certain rules.Similarly,an assignment operation also causes the automatic type conversion.THe type of data to the right of an assignment operator is automatically converted to the type of the variable on …

C++ : Type Conversions Read More »

C++ : Destructors

A destructor, as the name implies is used to destroy the objects that have been created by a constructor. Like a constructor, the destructor is a member function whose name is same as the class name but is preceded by a tilde (~). For example, the destructor for the class integer can be defined as …

C++ : Destructors Read More »

C++ : Functions

Introduction We know that function play an important role in C program development.Dividing a program into function is one of the major principles of top-down, structured programming.Another advantages of using functions is that it is possible to reduce the size of a program by calling and using them at different plcaes in the program. Recall …

C++ : Functions Read More »

C++ : Constructors

Introduction A constructor is a special member function whose task is to initialise the object of its class.it is special because its name is same as the class name.The constructor is invoked whenever an object of its associated class is created.It is called constructor because it construct the values of data member of the class. …

C++ : Constructors Read More »

C++ : Operator Overloading

Introduction Operator overloading is one of the most exciting features of object-oriented programming. It can transform complex, obscure program listings into intuitively obvious ones. For example, statements like      d3.addobjects(d1, d2); or the similar but equally obscure d3 = d1.addobjects(d2); can be changed to the much more readable d3 = d1 + d2; The …

C++ : Operator Overloading Read More »

C++ : Reference Variable, Manipulator and Scope Resolution Operator

  Reference Variable C++ introduces new kind of variable known as the reference variable.A reference variable provide an alias (alternative name) for a previously defined variable. A reference variable is created as follow:   data_type & reference-name = variable-name; For example, float total = 100; float& sum = total; cout << total; cout << sum; …

C++ : Reference Variable, Manipulator and Scope Resolution Operator Read More »

Learn Basics of C++

Simple C++ Program #include <iostream> Using namespace std; int main() { int number1; cin >> “Enter number1”; cout << number1; cout << “c++ is better than c n”; return 0; }   Program feature Like C, the C++ program is a collection of function. The above example contain only one function main(). As usual execution …

Learn Basics of C++ Read More »