what is the main difference between c and c++?
Answers were Sorted based on User's Feedback
Answer / priya
c language is top to bottom approach whereas c++ is bottom
to top approach
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / s prasanna kumar
C C++
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 ? | 0 Yes | 0 No |
Answer / pavankumarreddy
c is an object based language where as c++ is an object
oriendted languague. c doesnot supports oops concept,c++
supports oops.
in c there is no cocept of operator overloading, where as
it is in c++.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / viji
C is the main of the came for c++,java.It is must important
to the c.C is doesn't support overloding.But c++ support
overloading.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer /
c is like coffee
but c++ is like coffee with extra sugar
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / amit chidrewar
data abstraction and data encapsulation not present in c
while these are features of c++.Moreover emphasis are doing
on procedures in c while in c++ emphasis is dealing in
objects.Inheritance,polymorphism not present in c.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / chandan seta
In c we use #include<stdio.h> but in c++ we use
#include<iostream.h>
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / vaijayanthimala
c is a procedure oriented language and give importants to
procedure that is fuction rather than data.c is a middle
level language.
c++ is a object oriented language and give importants to
object that is data.c++ is high level language.
c does not provide class / object concept
c++ provides encapsulation ,data abstraction,polymorphism..
In c passing a value to a function is "call by value "
where c++ its " call by reference".
c is top to bottom programming approch.
c++ is bottom to top programmong approach.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / annie
1)C is procedure oriented language whereas c++ is object
oriented language.
2)C uses top down approach whereas c++ uses bottom up approach.
3)We can declare variables in the body of main() at the
beginning whereas we can declare variables anytime in c++
when we want to use them.
4)There is no concept of operator overloading in c whereas
there is a concept of operator overloading in c++.
| Is This Answer Correct ? | 0 Yes | 0 No |
Base class has two public data members. How can i derive a new class with one datamember as public and another data member as private?.
There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.
Question In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest. Question Submitted By :: Sunil Kumar I also faced this Question!! Rank Answer Posted By Re: In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest. Answer # 1 use copy constructors 0 Shanthila There is something to be taken care in destructor, in copy constructor, suppose the memory is assigned to the embedded member object pointer with the parameter passed value, but if some other objects of different class also are pointing to this memory, then if some one deletes the object then this class member pointer object will become dangling, or if the object is not deleted properly then there will be memory leak. Please suggest the design change required to handle or avoid this situation
What is new keyword in oops?
Why it is called runtime polymorphism?
what is the difference between class to class type conversion and copy constructor ?
What is polymorphism explain its types?
How to create a comment page in C #??
why c++ is a highlevel language
3 Answers Satyam, Tech Mahindra,
i^=j; j^=i; i^=j; value of i,j
Can a varargs method be overloaded?
what is the drawback of classical methods in oops?