difference between c and c++?
Answer Posted / mohd sarim
* C does not have any classes or objects. It is
procedure and function driven. There is no concept of access
through objects and structures are the only place where
there is a access through a compacted variable. c++ is
object oriented.
* C structures have a different behaviour compared to
c++ structures. Structures in c do not accept functions as
their parts.
* 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 functions do not support overloading. Operator
overloading is a process in which the same function has two
or more different behaviours based on the data input by the
user.
* 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.
* C has a top down approach whereas c++ has a bottom up
approach.
* In c a character constant is automatically elevated to
an integer whereas in c++ this is not the case.
* In c declaring the global variable several times is
allowed but this is not allowed in c++.
Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is the default access level?
Define a pointer to a data member of the type pointer to pointer?
Can we use clrscr in c++?
How does c++ structure differ from c++ class?
Why we use #include iostream in c++?
Explain the static storage classes in c++.
What is a base class?
Can you be bale to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?
When there is a global variable and local variable with the same name, how will you access the global variable?
List the advantages of inheritance.
How is computer programming useful in real life?
Can turbo c++ run c program?
what is software cycle? What is a mission critical system ? What is the important aspect of a real-time system ? Explain the difference between microkernel and macro kernel. Give an example of microkernel.Why paging is used ? Which is the best page replacement algo and Why ? What is software life cycle ? How much time is spent usually in each phases and why Which one do U want to work if selected in Honeywell ? Which are the different types of testing ? What is a distributed system ? Some questions about CSP. Which languages do U know ? What are the differences between Pascal and C. questions from Compiler construction and Lisp. Which are the different computer architecture? What is the requirement in MIMD ? What is the difference between RISC and CISC processors ? Difference between loosely coupled and tightly coupled systems ? What is an open system?
How c functions prevents rework and therefore saves the programers time as wel as length of the code ?
What is the use of seekg in c++?