Difference between C and C++

Posted Nov 04, 2009 by ausaus / comments 0 comments / Print / Font Size Decrease font size Increase font size

What are different types of polymorphism supported by C++ CA 2 What is Pure Virtual Function? Why and when it is used ? Lucent 4 given unsigned int ui1=3,ui2=7; what are the outputs of a)ui1 & ui2 b)ui1 && ui2 c)ui1 | ui2 d)ui1 || ui2 i also need the justification for the answers thank you

c is procedure oriented language and gives importance to 
procedure that is functions rather than data.c is middle
level language.
c++ is object oriented language and gives importance to
object that is data
c++ is high level language
c does not a class/object concept =>c++ provides data encapsulation,data abstraction,polymorphism. =>c++ support all c syntax =>in c passing value to a function is "call by value" where c++ its "call by reference"
C++ is the hight level language, but C is low level 
language.

C++ can support of all function of C, but C can't support
of all function of C++.

We can work with Class in C++, But we can't work with Class
in C

C++ is a object oriented language but C is not OOPS

C is the Top to bottom , but C++ is bottom to Top language.

Main difference between c and c++ are:
1.) In c++, there is strict typechecking and in c, there is
no strict typechecking. So, many programes which can
compiled by c compiler cannot be compiled by c++ compiler.

2.) In c, there is only "EARLY BINDING", whereas in c++,
there are "EARLY BINDING & LATE BINDING".

3.)C++ IS HIGH LEVEL LANGUAGE BUT 'C' IS LOW LEVEL LANGUAGE.

4.)In c++,there is a new concept of "INLINE FUNCTIONS",
whereas in c, there are macros.

5.)C++ is a object oriented language but C is not OOPS.

c is procedure oriented language and gives importance to 
procedure that is functions rather than data.c is middle
level language.
c++ is object oriented language and gives importance to
object that is data
c++ is high level language
c++ havig extra benifits data can hide in the fuction
(encapsulation),polymorphism,templets,file
handeling,inharitance.
c is structured design,c++ is object oriented design
c is top-down approach,c++ is bottom-top approach
c++ is required acces specifiers,c is not required acces
specifiers
c++ is client server model
In c++,there is a new concept of "INLINE FUNCTIONS",
whereas in c, there are macros.
C++ is a object oriented language but C is not OOPS.
1.C language is easy as compare to c++.Because in one side 
c++ show inheritance so another side its show the
properties of encapslution which are the contrast or weaken
point to inheritance due to encapslution.
2.In C the function pass from one funtion to another
several times while in C++ the function is hidden through
some external function.
3.C is a procedural or structural oriented language uses
ups-down approch and focus on procedure rather than data
while C++ is an object-oriented language uses down-ups
approch and focus on data rather than procedure.
4.C language uses pointer concept while there is no concept
of pointer in C++.
5.C++ is a prototype or a strick typechecking where C is
free of such things, so most programmes which is compiled
by C compiler cannot be compiled by C++ compiler.

#include................#include
#include . #include
void main() . void main()
{ . {
int a,b,c; . int a,b;
printf("enter 2 no."); . cout<<"enter two number";
scanf("%d%d",&a,&b); . cin>>a>>b;
c=a+b; . int c=a+b;
printf("sum is=%d"c); . cout<<"sum is="<getch(); . getch
(); .
} . }

so from above we know that in c variables are declared in
above bt in case of C++ variable declaration can be
anywhere .whenever we need we declare variables

Rate this Article:

Be the first to rate me.

Image by qnr via Flickr

* You must be logged in order to leave comments, please login or join us.

Comments

No comments yet.



Bookmark and Share
Sign up for our email newsletter
Name:
Email: