what is the main difference between c and c++?

Answers were Sorted based on User's Feedback



what is the main difference between c and c++?..

Answer / rajendra kumar jena

C is a procedural Language, but C++ is a object oriented
language.

* C employs top down approach, but c++ employes buttom up
approach.

* Here in C, when ever we are writing a program, the data
are not secured from the outside world. but in C++ data are
secured from the outside world.

* C give emphasis in algorithims and functions, but C++
give emphasis on the data and objects.

* In C we are using #include<stdio.h> as header file, but
in C++ we are using #include<iostream.h> as header file.

Is This Answer Correct ?    480 Yes 71 No

what is the main difference between c and c++?..

Answer / krushna priya nath

A function can be declared in C as int fun();. This means
that fun()is a function without any argument or any number
of arguments.But in C++, this means that the function with
no argument at all.

Is This Answer Correct ?    613 Yes 267 No

what is the main difference between c and c++?..

Answer / vivek goyanr

In C memory allocation is done with malloc statement whereas
in C++ it is done through new keyword.Also memory is
deallocated in C using free statement while in C++
deallocation takes place through delete.

Is This Answer Correct ?    452 Yes 108 No

what is the main difference between c and c++?..

Answer / daisy golwala

here are some difference between c and c++ ---
1. C is a PROCEDURE oriented programming language.
-> C++ is a OBJECT oriented programming language.
2. We can do programming through STRUCTURE,but NOT with the
help of the CLASS.
-> We can do programming through CLASS in c++.
3. C is a LOW level language.
->C++ is a HIGH level language.
4. C is a TOP->BOTTOM programming approch.
->C++ is a BOTTOM->TOP programming approch.
5. C is a collection of FUNCTIONS.
-> C++ is a collection of FUNCTIONS and/or CLASS.
6. c language main focuses on PROCEDURES.
-> c++ programming main focuses on OBJECTS.
7. In C,DATA can be MOVE openly around in the system from
function to function.
-> In C++,DATA is HIDDEn.It can not be accessed by external
functions.
8.C can not support all the feature of the C++.while c++
support all the features of C.
9. C NEEDS FORMAT CHARACTERS for printing & scanning.
-> C++ DOES NOT REQUIRED FORMAT SPECIFIER for printing and
scanning variable.
10. C variables are DECLARED in declaration section.
-> C++ variables are DECLARED any where in the program.
11. In C,we use PRINTF() ,SCANF() as standard input/output
functions.
-> In C++,we can use COUT<< or CIN>> as standard
input/output function.
12. In C,you can NOT OVERLOAD a function.
-> In C++ ,you can OVERLOAD the operator as well as
functions.
13. C does NOT have NAMESPACE for avoid name collisions.
-> c++ has NAMESPACE feature.
14.C does NOT have REFERENCE variables.
-> In C++ ,REFERENCE variables are USED in functions.
15. In C,constants are defined as 'MACROS'.
-> We can make a use of 'CONST' TO declare a constant.
16.In C program , the MAIN() should NOT RETURN a value.
-> In C++,MAIN() should RETURN a value.
17. C does NOT SUPPORT DEFAULT arguments.
-> C++ PROVIDES DEFAULT argument concept.

Is This Answer Correct ?    376 Yes 49 No

what is the main difference between c and c++?..

Answer / dheeru bhai

c does not support the c++ programme but c++ support the c
program.

Is This Answer Correct ?    384 Yes 74 No

what is the main difference between c and c++?..

Answer / aashish salotra

DIFFERENCE b/w C and C++
1.) C was the C++ predecessor. As its name implies, alot of
C remains in C++. Although not actually being more powerful
than C, C++ allows the programmer to more easily manage and
operate with Objects, using an OOP (Object Oriented
Programming) concept.

2.) C++ allows the programmer to create classes, which are
somewhat similar to C structures. However, to a class can be
assigned methods, functions associated to it, of various
prototypes, which can access and operate within the class,
somewhat like C functions often operate on a supplied
handler pointer.

3.) Although it is possible to implement anything which C++
could implement in C, C++ aids to standardize a way in which
objects are created and managed, whereas the C programmer
who implements the same system has alot of liberty on how to
actually implement the internals, and style among
programmers will vary alot on the design choices made.

4.) In C, some will prefer the handler-type, where a main
function initializes a handler, and that handler can be
supplied to other functions of the library as an object to
operate on/through. Others will even want to have that
handler link all the related function pointers within it
which then must be called using a convention closer to C++.

5.) In C, there's only one major memory allocation function:
malloc. You use it to allocate both single elements and
arrays. In C++, however, memory allocation for arrays is
somewhat different than for single objects; you use the
new[] operator, and you must match calls to new[] with calls
to delete[] (rather than to delete).

6.) C++ applications are generally slower at runtime, and
are much slower to compile than C programs. The low-level
infrastructure for C++ binary execution is also larger. For
these reasons C is always commonly used even if C++ has alot
of popularity, and will probably continue to be used in
projects where size and speed are primary concerns, and
portable code still required (assembly would be unsuitable
then).

7.) In C++, you are free to leave off the statement 'return
0;' at the end of main; it will be provided automatically
but in C, you must manually add it.

8.) A function can be declared in C as int fun( );. This
means that fun( ) is a function without any argument or any
number of arguments. But in C++, this means that the
function with no argument at all.

9.) C++ support operator overloading but c doesn't support
operator overloading.

Is This Answer Correct ?    239 Yes 44 No

what is the main difference between c and c++?..

Answer / shaliza garg

C++ applications are generally slower at runtime, and are
much slower to compile than C programs. The low-level
infrastructure for C++ binary execution is also larger. For
these reasons C is always commonly used even if C++ has
alot of popularity, and will probably continue to be used
in projects where size and speed are primary concerns, and
portable code still required (assembly would be unsuitable
then).

Is This Answer Correct ?    246 Yes 82 No

what is the main difference between c and c++?..

Answer / shaik usman ali

IN "C" WE CAN'T FOUND OPERATOR OVERLOADING CONCEPT WHERE AS
IN C++ IT IS POSSIBLE.THIS IS THE FIRST AND FORE MOST
DIFFERENCE BETWEEN THESE TWO LANGUAGES.
THAT TO BE "++ OPERATOR OVERLOATING" IS DONE FIRST.
THIS IS THE MAJOR DIFFERENCE BETWEEN C AND C++ PROGRAMMING
LANGUAGES.

Is This Answer Correct ?    214 Yes 52 No

what is the main difference between c and c++?..

Answer / rohit

DIFFERENCE b/w C and C++
1.) C was the C++ predecessor. As its name implies,
alot of
C remains in C++. Although not actually being more powerful
than C, C++ allows the programmer to more easily manage and
operate with Objects, using an OOP (Object Oriented
Programming) concept.

2.) C++ allows the programmer to create classes, which
are
somewhat similar to C structures. However, to a class can be
assigned methods, functions associated to it, of various
prototypes, which can access and operate within the class,
somewhat like C functions often operate on a supplied
handler pointer.

3.) Although it is possible to implement anything
which C++
could implement in C, C++ aids to standardize a way in which
objects are created and managed, whereas the C programmer
who implements the same system has alot of liberty on how to
actually implement the internals, and style among
programmers will vary alot on the design choices made.

4.) In C, some will prefer the handler-type, where a
main
function initializes a handler, and that handler can be
supplied to other functions of the library as an object to
operate on/through. Others will even want to have that
handler link all the related function pointers within it
which then must be called using a convention closer to C++.

5.) In C, there's only one major memory allocation
function:
malloc. You use it to allocate both single elements and
arrays. In C++, however, memory allocation for arrays is
somewhat different than for single objects; you use the
new[] operator, and you must match calls to new[] with calls
to delete[] (rather than to delete).

6.) C++ applications are generally slower at runtime,
and
are much slower to compile than C programs. The low-level
infrastructure for C++ binary execution is also larger. For
these reasons C is always commonly used even if C++ has alot
of popularity, and will probably continue to be used in
projects where size and speed are primary concerns, and
portable code still required (assembly would be unsuitable
then).

7.) In C++, you are free to leave off the
statement 'return
0;' at the end of main; it will be provided automatically
but in C, you must manually add it.

8.) A function can be declared in C as int fun( );. This
means that fun( ) is a function without any argument or any
number of arguments. But in C++, this means that the
function with no argument at all.

9.) C++ support operator overloading but c doesn't
support
operator overloading.


by:- ROHIT AGGARWAL
PUNJAB

Is This Answer Correct ?    191 Yes 35 No

what is the main difference between c and c++?..

Answer / luckyy

C++ is object oriented language and c is object based
language..

Is This Answer Correct ?    253 Yes 99 No

Post New Answer

More OOPS Interview Questions

Have you ever used threads?

3 Answers   Adobe, IBM,


How is data security provided in Object Oriented languages? ?

5 Answers  


what is graphics

0 Answers  


which is best institute to learn c,c++ in ameerpet hyderabad

1 Answers  


Can abstract class have normal methods?

0 Answers  






What is this pointer in oop?

0 Answers  


What is encapsulation in simple terms?

0 Answers  


what is SPL in c++.

1 Answers  


Why is abstraction needed?

0 Answers  


What does sksksk mean in text slang?

0 Answers  


WHY FUCTION OVERLOADING DOSENOT RETURN A RETEN TYPE

2 Answers  


What is virtual Function.

1 Answers   Wipro,


Categories