Monday 10 September 2012

C++ ( Tutorial I )

For those people who know C programming, it would be useful to know the differences between C and C++. Basically C++ includes everything present in C but the use of some C features is deprecated in C++.
C does not have classes and objects (C does not support OOP)
Structures in C cannot have functions.
C does not have namespaces (namespaces are used to avoid name collisions).
The I/O functions are entirely different in C and C++ (ex: printf( ), scanf( ) etc. are part of the C language).
You cannot overload a function in C (i.e. you cannot have 2 functions with the same name in C).
Better dynamic memory management operators are available in C++.
C does not have reference variables (in C++ reference variables are used in functions).
In C constants are defined as macros (in C++ we can make use of ‘const’ to declare a constant).
Inline functions are not available in C.

0 comments:

Post a Comment