C vs c++

1,315 views

Published on

Published in: Education, Technology
3 Comments
5 Likes
Statistics
Notes
  • as i read in your slide-
    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.
    Can You Please Explain via some example
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • niceeeeeeeeeeeeeeeeee
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • nice one
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
1,315
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
233
Comments
3
Likes
5
Embeds 0
No embeds

No notes for slide

C vs c++

  1. 1. Name : Gaurav BadhanCSE-N1-115307Univ. Roll no : 1144352
  2. 2. Contents Introduction C language, C++ language Similarities Built-in data types, compiler preprocessors etc. Differences Basic , Data security, Processing approach etc. Conclusion
  3. 3.  C (pronounced as "see”) is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories. Although C was designed for implementing system,it is also widely used for developing portable application software. C is one of the most widely used programming languages of all timeand there are very few computer architectures for which a C compiler does not exist.
  4. 4.  C++ (pronounced "cee plus plus") is a statically typed,free-foem, multi paradigm,compiled, general- purpose programming languauge. It is regarded as an intermediate-level language, as it comprises a combination of both high level and low level language features. It was developed by Biarne Stroustrup starting in 1979 at Bell labs as an enhancement to the C language. Originally named C with Classes, the language was renamed C++ in 1983, as a pun involving the increment operator. C++ is one of the most popular programming languages with application domains including systems software, application drivers, device drivers, embedded software, high-performance server and client applications
  5. 5.  same built-in data types. e.g.
  6. 6.  same compiler preprocessor  handles #include & #define  conditional preprocessing #if, #ifndef and #endef
  7. 7.  same built-in operators on primitive types (+-/*……)
  8. 8.  Same built-in control structures -if, for, while, switch ….etc For If
  9. 9.  must have a function names “main” to determine where the program starts. e.g. void main(),int main() functions are defined the same way. programs can be split up into separate files e.g. functions prototype & calling etc.
  10. 10.  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.
  11. 11.  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.
  12. 12.  C is a low-level language while C++ is a middle-level language. C is regarded as a low-level language(difficult interpretation & less user friendly) while C++ has features of both low-level(concentration on what is going on in the machine hardware) & high- level languages(concentration on the program itself) & hence is regarded as a middle-level language.vel language.
  13. 13.  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.
  14. 14.  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.
  15. 15.  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). C++ supports function overloading while C does not support.
  16. 16.  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).
  17. 17.  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.
  18. 18.  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.
  19. 19. C++, as the name suggests is a superset ofC. As a matter of fact, C++ can run most ofC code while C cannot run C++ code.Both C and C++ have their best place attheir own with ample similarities anddifferences.Although C++ is a Superset of C languageyet c has its own existence and C++ hasalso its own place in software and programdevelopment.

×