Skip to main content

DIFFERENCES BETWEEN C AND C++


                               C                              C++
1. C is Procedural Language.1. C++ is non Procedural i.e Object oriented Language.
2. No virtual Functions are present in C2. The concept of virtual Functions are used in C++.
3. In C, Polymorphism is not possible.3. The concept of polymorphism is used in C++.
Polymorphism is the most Important Feature of OOPS.
4. Operator overloading is not possible in C.4. Operator overloading is one of the greatest Feature of C++.
5. Top down approach is used in Program Design.5. Bottom up approach adopted in Program Design.
6. No namespace Feature is present in C Language.6. Namespace Feature is present in C++ for avoiding Name collision.
7. Multiple Declaration of global variables are allowed.7. Multiple Declaration of global varioables are not allowed.
8. In C
  • scanf() Function used for Input.
  • printf() Function used for output.
8. In C++
  • Cin>> Function used for Input.
  • Cout<< Function used for output.
9. Mapping between Data and Function is difficult and complicated.9. Mapping between Data and Function can be used using "Objects"
10. In C, we can call main() Function through other Functions10. In C++, we cannot call main() Function through other functions.
11. C requires all the variables to be defined at the starting of a scope.11. C++ allows the declaration of variable anywhere in the scope i.e at time of its First use.
12. No inheritance is possible in C.12. Inheritance is possible in C++
13. In C, malloc() and calloc() Functions are used for Memory Allocation and free() function for memory Deallocating.13.In C++,  new and delete operators are used for Memory Allocating and Deallocating.
14. It supports built-in and primitive data types.14. It support both built-in and user define data types.
15. In C, Exception Handling is not present.15. In C++, Exception Handling is done with Try and Catch block.

Comments

Popular posts from this blog

IP ADDRESS CLASSES

IP address classes Class 1 st  Octet Decimal Range 1 st  Octet High Order Bits Network/Host ID (N=Network, H=Host) Default Subnet Mask Number of Networks Hosts per Network (Usable Addresses) A 1 – 126* 0 N.H.H.H 255.0.0.0 126 (2 7  – 2) 16,777,214 (2 24  – 2) B 128 – 191 10 N.N.H.H 255.255.0.0 16,382 (2 14  – 2) 65,534 (2 16  – 2) C 192 – 223 110 N.N.N.H 255.255.255.0 2,097,150 (2 21 – 2) 254 (2 8  – 2) D 224 – 239 1110 Reserved for Multicasting E 240 – 254 1111 Experimental; used for research Note:  Class A addresses 127.0.0.0 to 127.255.255.255 cannot be used and is reserved for loopback and diagnostic functions. Private IP Addresses Class Private Networks Subnet Mask Addr...

UNIX/LINUX COMMAND

Unix / Linux Command cat  --- for creating and displaying short files chmod  --- change permissions cd  --- change directory cp  --- for copying files date  --- display date echo  --- echo argument ftp  --- connect to a remote machine to download or upload files grep  --- search file head  --- display first part of file ls  --- see what files you have lpr  --- standard print command (see also  print  ) more  --- use to read files mkdir  --- create directory mv  --- for moving and renaming files ncftp  --- especially good for downloading files via anonymous  ftp . print  --- custom print command (see also  lpr  ) pwd  --- find out what directory you are in rm  --- remove a file rmdir  --- remove directory rsh  --- remote shell setenv  --- set an environment variable sort  --- sort file tail  --- display last part of file ta...

PHP CODE TO DISPLAY IMAGE

<html>     <head>         <title>Img to PHP</title>     </head>     <body>         <?php         $x=0;         echo "<h4>";                echo "<u>LOOP1</u>";                 while($x<=5)                 {                     //echo " ".$x;                     $x++; //$x=$x+1                         ?>         <font color="red">HELLO PHP</font>     <?php     echo ''.$x.'.jpg';     echo "<br>";     echo '<img src='.$x.'.jpg'.' '.'height=50 ...