Diff 1
Diff 1
com/lesson/page/4155-difference-between-c-and-c
C input/output is based on library and the processes are carried out by including
functions. C++ i/o is made through console commands cin and cout.
C does not support new or delete commands. The memory operations to free or
allocate memory in c are carried out by malloc() and free().
Undeclared functions in c++ are not allowed. The function has to have a prototype
defined before the main() before use in c++ although in c the functions can be
declared at the point of use.
After declaring structures and enumerators in c we cannot declare the variable for
the structure right after the end of the structure as in c++.
For an int main() in c++ we may not write a return statement but the return is
mandatory in c if we are using int main().
In C++ identifiers are not allowed to contain two or more consecutive underscores
in any position. C identifiers cannot start with two or more consecutive
underscores, but may contain them in other positions.
1 of 2 12/28/2008 6:26 AM
Difference between c and c++ — LearnHub http://compsci.learnhub.com/lesson/page/4155-difference-between-c-and-c
In c declaring the global variable several times is allowed but this is not allowed in
c++.
2 of 2 12/28/2008 6:26 AM