Difference between C and C++ programming languages. C++ is developed from C language. So there is no much difference both of them. A number of C programs can be easily compiled in the C++ compiler. All the C operators are valid in C++ and C++ and C expressions are the same. But there are also many differences between them.
for more visit: http://stacksol.com/difference-between-c-cpp-programming-languages/
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
What is the Difference Between C and C++ Programming Languages
1. What is the Difference Between C and
C++ Programming Languages?
C++ is developed from C language. So there is no much difference both of them. A
number of C programs can be easily compiled in the C++ compiler. All the C operators
are valid in C++ and C++ and C expressions are the same. But there are also many
differences between them.
The major difference between C and C++ is that C is a procedural programming
language and does not support classes and objects, while C++ is a combination of both
procedural and object oriented programming language; therefore C++ can be called a
hybrid language. But although, here we discussed some differences
between C and C++ programming languages.
Difference Between C and C++ Programming
Languages
2. C++ was developed by Bjarne Stroustrup in 1979 with C++’s predecessor “C with
Classes”.
C was developed by Dennis Ritchie between 1969 and 1973 at AT&T Bell Labs.
C++ supports Exception Handling
C does not support Exception Handling.
C++ supports functions with default arrangements.
C does not support functions with default arrangements
C is a mid-level programming language.
C++ is a high level language.
C++ is a superset of C
When compared to C++, C is a subset of C++.
In C++, main() function cannot be called through other functions.
In C, main() function can be called through other functions.
C++ is an object oriented programming language.
C is a structural or procedural programming language.
In C, Functions are the fundamental building blocks.
In C++, Objects are the fundamental building blocks.
C provides malloc() and calloc()functions for dynamic memory allocation,
and free() for memory de-allocation.
C++ provides new operator for memory allocation and delete operator for memory de-
allocation.
3. C++ supports reference variables.
C does not support reference variables.
C does not support function overloading.
C++ supports function overloading, implying that one can have name of functions with
varying parameters.
In C++, Data is hidden and can’t be accessed by external functions.
In C, the data is not secured.
C++ supports virtual and friend functions.
C has no support for virtual and friend functions.
C++ is compatible with generic programming
C is not compatible
C follows top down approach.
C++ follows bottom up approach
C++ uses cin>> and cout<< for standard input and output.
C uses scanf() and printf() function for standard input and output.
In C++, functions can be used inside a structure.
C does not allow functions to be defined inside structures.
C++ supports both function and operator overloading.
C does not support function and operator overloading.
4. In C++, Encapsulation hides the data to ensure that data structures and operators are
used as intended.
In C, data are free entities and can be manipulated by outside code. This is because C
does not support information hiding. (Encapsulation Feature)
C++ supports both pointers and references.
C supports only Pointers
C++ has inline function.
C does not have inline function
Variable can be defined anywhere in the function.
In C, variable has to be defined at the beginning, in the function.
The programs in C language are divided into modules and functions.
The programs are divided into classes and functions in the C++ programming language.
The file extension in C is .C
The file extension in C++ is .CPP
C does not support object oriented programming; therefore it has no support for
polymorphism, encapsulation, and inheritance.
Being an object oriented programming language C++ supports polymorphism,
encapsulation, and inheritance.
Understanding the difference between C and C++ and their relative strengths can help
companies leverage them more effectively in their software development projects. This
knowledge alongside expert help provided software development experts could make
C/C++ based projects more successful.
For more visit: http://www.stacksol.com