CPP Tutorial

CPP examples programs

C vs CPP

CPP is a general purpose Object Oriented Programming language which evolved as an extension to C language. It is an intermediate level language, as it encapsulates the features of both high and low level language. If we compare C with CPP, the major difference is that C is a procedural language, however, C++ is an object oriented language. Other major differences are listed below:

 

CPP C
Supports both procedural and object oriented style of programming. Supports only procedural style of programming.
Modifiers can be used for class members to make it inaccessible for outside users. Data is less secured.
Follow bottom-up approach. Follow top-down approach.
cin and cout are used to perform input and output operations. scanf() and printf() are used for input/output.
Supports reference variables. Does not support reference variables.
Operator overloading is possible Operator overloading is not possible
Functions can be used in structure. Functions cannot be used in structure.
Programs are divided into functions and classes. Programs are divided into procedures and modules.
Supports function overloading. Does not support function overloading.
Provides exception handling using Try and Catch block. Exception handling can only be performed using other functions.
Supports the feature of namespace. Does not support the feature of namespace.