You are on page 1of 10

8/4/2010 what is the main difference between c a…

Advertise your Business Here

Browse | Placement Papers | Company | Code Snippets | Certifications | Visa Questions

Post Question | Post Answer | My Panel | Search | Articles | Topics | ERRORS new

Refer this Site Login | Sign Up

Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!!
you can post that stuff HERE

Search

Categories >> Software >> Programming Languages >> C++ >> OOPS

C & C++ Jobs


MNCs are Hiring Submit your Resume Free Now.
MonsterIndia.com

Openings in C++
Exp: 1 to 13 Yrs.Sal: 5L to 15L PA Apply Now &
get Multiple Interviews
TimesJobs.com/C++

Manipal Univ MS Degrees


Need to Build Your Career. Without Giving up
your job. Apply Now !
Manipal.edu/AdmissionsOpen

www.Aptech-Education.com Ads by Google

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


Interview Question Submitted By :: Ramachandra
Questions I also faced this Question!! Rank Answer Posted By

OOPS Re: what is the main difference between c and c++?


Interview Answer c is not object oriented but c++ is object oriented 3 Richa
Questions #1

C++ Is This Answer Correct ? 2373 Yes 219 No


General
Interview
Re: what is the main difference between c and c++?
Questions
Answer Actually c is a procedural programming language which 3 Rajeev Kumar
# 2 cann't face the real world problem. It has some drawback
like a global data is shared by all function and if in a
large program it is find out difficult that which function
uses which data.

allinterview.com/…/33052.html 1/10
8/4/2010 what is the main difference between c a…
On the other hand c++ is an object oriented programming
language which eliminate some pitfall of conventional or
procedural programming language. It is a concept or
approach for designing a new software. It is nothing to do
with any programming language although a programming
language which support the oops concept to make it easier
to implement.

This is the main different between c and c++.

Is This Answer Correct ? 1641 Yes 205 No

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


Answer in c we use scanf function as standard input function,while 3 Chetna Chaudhari
# 3 in c++ we use streame cin>> for input.like this for output
in c we use printf function,while in c++ we use cout<< as a
output function.

Is This Answer Correct ? 1022 Yes 379 No

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


Answer in c we use #include<stdio.h>as iclusion file,while in c++ 2 Chetna
# 4 we use #include<iostreame>as inclusion file. Chaudhari,jalgaon

Is This Answer Correct ? 805 Yes 452 No

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


Answer In object oriented programming, the programmer can solve 4 Sumit Gupta ,
# 5 problems by breaking them down into real-life objects (it Bangalore
presented the programmer with an opportunity to mirror real
life). What is an object? This topic is dealt with
extensively in the chapter on ‘Objects and Classes’ but a
brief introduction is provided here.

Consider the category of cars. All cars have some common


features (for example all cars have four wheels, an engine,
some body colour, seats etc.). Are all cars the same? Of
course not. A Fiat and a Ford aren’t the same but they are
called as cars in general. In this example cars will form a
class and Ford (or Fiat) will be an object.

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).
allinterview.com/…/33052.html 2/10
8/4/2010 what is the main difference between c a…
*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.

Is This Answer Correct ? 759 Yes 98 No

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


Answer c is a topdown approach while c++ is bottom up approach 3 Ketan
#6

Is This Answer Correct ? 764 Yes 136 No

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


Answer IN c-programe the main function could not return a value 3 Satyajith Srinivas
# 7 but in the c++ the main function shuld return a value

Is This Answer Correct ? 356 Yes 544 No

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


Answer The main Difference between C and C++ is C is Object Based 3 Jayasrinivas.donavalli
# 8 program.that means in C also we have Object based
Applications like Structures and Unions.
C++ is Object Oriented Language that means entire
application will be depending on Objects only.
Uses of Object oriented Program is Reusability,Increase the
effiency of the program and it gives extra security like
Private data is also be there in C++.
C++ is the Advanced version of C.
In otherwords we say c++ supports both Object based and
Object oriented Applications

Is This Answer Correct ? 414 Yes 97 No

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


Answer A function can be declared in C as int fun();. This means 1 Krushna Priya Nath
# 9 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 ? 246 Yes 114 No

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


Answer The main difference between c and c++ is that " C is a 1 K.r.sukumar
# 10 structured programming language while C++ is an object
programming language and also we have templates in C++ that
is not the case in C

allinterview.com/…/33052.html 3/10
8/4/2010 what is the main difference between c a…

Is This Answer Correct ? 354 Yes 59 No

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


Answer In C memory allocation is done with malloc statement whereas 2 Vivek Goyanr
# 11 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 ? 274 Yes 71 No

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


Answer c++ support operator overloading but 4 Uma
# 12 c doesn't support operator overloading..

Is This Answer Correct ? 343 Yes 62 No

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


Answer C C++ 4 Mayuri
# 13
DATA IS NOT SECURED SECURED

TOP DOWN BOTTOM-UP

FOCUS ON PROCEDURES FOCUS ON DATA

PROGRAMS ARE DECOMPOSED INTO OBJECTS


INTO FUNCTIONS

allocation is done NEW OPERATOR


with malloc statement

UNOINS AND ENUMS AVALIABLE


ARE NOT AVALIABLE

DOES NOT PROVIDE PROVIDES


DEFAULT ARGUMENTS

Is This Answer Correct ? 541 Yes 79 No

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


Answer C is a procedural Language, but C++ is a object oriented 5 Rajendra Kumar Jena
# 14 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.

allinterview.com/…/33052.html 4/10
8/4/2010 what is the main difference between c a…

Is This Answer Correct ? 299 Yes 41 No

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


Answer C++ applications are generally slower at runtime, and are 2 Shaliza Garg
# 15 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 ? 154 Yes 52 No

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


Answer c is function or procedure oriented whereas c++ is object 2 Prakash Kumawat
# 16 oriented.it focus primariy on tht actions and events and
the programming model focuses on the logical assertions
that trigger execution of programme code whereas c++is
focusedon writingprogramas thet are more readable and
maintainable and helps the reuse of code by packing a group
of similar objects,inheritance and polymorphism. C was THE
C++ predecessor. A lot of c remains in c++.In c, the
result of applying the operator size to a character
constant. for example:- size of('c'),equalssize of (int).IN
c++,the expressionsize of('c'),returns size of(char).

Is This Answer Correct ? 113 Yes 40 No

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


Answer c does not support the c++ programme but c++ support the c 2 Dheeru Bhai
# 17 program.

Is This Answer Correct ? 225 Yes 42 No

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


Answer c is low level language while c++ is sn high level language. 0 Ravi Pratap
# 18 c++ is an extension of c language this means that you can
use not only the new features of c++ but can also use the c
programing on that. c++ is an object oriented while c is an
program oriented in which you can make new softwares.

Is This Answer Correct ? 139 Yes 75 No

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


Answer DIFFERENCE b/w C and C++ 3 Aashish Salotra
# 19 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

allinterview.com/…/33052.html 5/10
8/4/2010 what is the main difference between c a…
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 ? 151 Yes 27 No

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


Answer IN "C" WE CAN'T FOUND OPERATOR OVERLOADING CONCEPT WHERE AS 3 Shaik Usman Ali
# 20 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 ? 130 Yes 36 No

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


Answer here are some difference between c and c++ --- 4 Daisy Golwala
allinterview.com/…/33052.html 6/10
8/4/2010 Answer what is the main difference between c a… 4 Daisy Golwala
# 21 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 ? 249 Yes 32 No

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


Answer C++ is object oriented language and c is object based 2 Luckyy
# 22 language..

Is This Answer Correct ? 156 Yes 68 No

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


Answer DIFFERENCE b/w C and C++ 3 Rohit
# 23 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

allinterview.com/…/33052.html 7/10
8/4/2010 what is the main difference between c a…
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 ? 131 Yes 21 No

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


Answer C gives importance to procedure. That is functions rather 2 S.kannigaarasu
# 24 than data. The main function couldnot return a value. It is
dont support c++ programme.
C++ gives importance to object that is data. The main
function should return a value. It is support c programme.
allinterview.com/…/33052.html 8/10
8/4/2010 what is the main difference between c a…

Is This Answer Correct ? 121 Yes 25 No

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


Answer C comes after A,B 4 Uma Shankar
# 25 and c++ comes after adding ++ in C

Is This Answer Correct ? 146 Yes 386 No

1 2 3 4 5 6 7 8 >>

Other OOPS Interview Questions

Question Asked @ Answers

Difference between over loading and over ridding? CTS 11


Why many objects can working together? How objects working togetherM I
2
want to see example code.
why overriding? 3
What is a scope operator and tell me its functionality? emc2 2
What are generic functions and generic classes? 5
should we use linear search or binary search if elements are placed in random
2
order or mixed?in both cases? i need a little bit detail ans?thnks
Write 7 differences between "Public" function and "Private" function? IBM 2
What is the expansion of OOPS? TCS 19
can we create and enter the data & hide files using programmes ? Wipro 1
why c++ is called OOPS? waht is inherutance? what is compiler? 5
wht is major diff b/w c and c++? 6
Polymorphism with an example? emc2 6
Which is the best institute in hyderabad for C/C++ and it also has fast track
2
course structure.
What is deep and shalow copy? TCS 3
how much classes are used in c++ 4
Pls...could any one tell me that whether we can access the public data
memeber of a class from another class with in the same program. Awaiting for 4
your response Thanku
what is meant by files? Infosys 4
#include <iostream> using namespace std; int main() { int a = 3; int c[5][5]; for

allinterview.com/…/33052.html 9/10
8/4/2010 what is the main difference between c a…
(int x=0;x<5;x++) { for (int y=0;y<5;y++) { c[x][y] = x*y; } } cout << 1
c[a][2]; }
Which is the parameter that is added to every non-static member function
3
when it is called?
difference between structure and union. Convergys 2

For more OOPS Interview Questions Click Here

Copyright Policy | Terms of Service | Help | Site Map 1 | Articles | Site Map | Site Map |
Contact Us |

Copyright © 2009 ALLInterview.com. All Rights Reserved.

ALLInterview.co m :: Fo rum9.co m :: KalAajKal.co m

allinterview.com/…/33052.html 10/10

You might also like