Author Topic: difference between c and c++  (Read 2956 times)

0 Members and 1 Guest are viewing this topic.

Offline sam234

  • Member
  • Newbie
  • *
  • Points: 5
  • Posts: 21
    • View Profile
difference between c and c++
« on: September 11, 2012, 07:23:10 pm »
 :rtfr the 10 major differences between C++ & C...[/b]

1. C follows the procedural programming paradigm while C++ is a multi-paradigm language(procedural as well as object oriented)

In case of C, importance is given to the steps or procedure of the program while C++ focuses on the data rather than the process.
Also, it is easier to implement/edit the code in case of C++ for the same reason.

2. In case of C, the data is not secured while the data is secured(hidden) in C++

This difference is due to specific OOP features like Data Hiding which are not present in C.

3. C is a low-level language while C++ is a middle-level language (Relatively, Please see the discussion at the end of the post)

C is regarded as a low-level language(difficult interpretation & less user friendly) while C++ has features of both low-level(concentration on whats going on in the machine hardware) & high-level languages(concentration on the program itself) & hence is regarded as a middle-level language.

4. C uses the top-down approach while C++ uses the bottom-up approach

In case of C, the program is formulated step by step, each step is processed into detail while in C++, the base elements are first formulated which then are linked together to give rise to larger systems.

5. C is function-driven while C++ is object-driven

Functions are the building blocks of a C program while objects are building blocks of a C++ program.

6. C++ supports function overloading while C does not

Overloading means two functions having the same name in the same program. This can be done only in C++ with the help of Polymorphism(an OOP feature)

7. We can use functions inside structures in C++ but not in C.

In case of C++, functions can be used inside a structure while structures cannot contain functions in C.

8. The NAMESPACE feature in C++ is absent in case of C

C++ uses NAMESPACE which avoid name collisions. For instance, two students enrolled in the same university cannot have the same roll number while two students in different universities might have the same roll number. The universities are two different namespace & hence contain the same roll number(identifier) but the same university(one namespace) cannot have two students with the same roll number(identifier)

9. The standard input & output functions differ in the two languages

C uses scanf & printf while C++ uses cin>> & cout<< as their respective input & output functions

10. C++ allows the use of reference variables while C does not

Reference variables allow two variable names to point to the same memory location. We cannot use these variables in C programming.
You do not have permission to give points
point 0 Points

This topic did not receive points.

Offline cynusalisa

  • Banned
  • Newbie
  • *
  • Points: 0
  • Posts: 12
    • View Profile
    • http://ggi.ac.in/
difference between c and c++
« Reply #1 on: October 05, 2012, 10:10:54 am »
Hey Thanks For Sharing this With us. I Like to Get these differences Between two Major Programming Languages. I mutually did not knows about it But Now wanna say thanks for It.
**** NO ADVERTISEMENTS ****

 

Difference Between Draft Lokpal Bill and Jan Lokpal Bill

Started by techmaniac

Replies: 0
Views: 3406
Last post April 08, 2011, 02:37:05 pm
by techmaniac
Difference between bluetooth 2.0 and bluetooth 2.1

Started by Shankynayak

Replies: 1
Views: 1946
Last post August 18, 2012, 12:19:49 pm
by RamakantPareek
Difference Between Fraunhofer Diffraction And Fresnel Diffraction

Started by XYLS

Replies: 1
Views: 3676
Last post January 06, 2014, 05:23:53 pm
by ranjan82
What is the difference b/w morning shift and evening shift

Started by BEN TENNYSON

Replies: 6
Views: 5014
Last post May 09, 2013, 10:13:03 pm
by Champ
Difference Between Nokia 920, Samsung Galaxy S3 And Apple iPhone 5

Started by XYLS

Replies: 2
Views: 2211
Last post January 06, 2014, 05:18:58 pm
by ranjan82
Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49