Friday, April 15, 2011

Difference between C & C++.


Difference between C & C++.

Introduction:- C programming language was designed by Dennies Ritchie in the early 1970s at Bell Laboratories. It was first used system  implementation language for the nascent Unix operating system. The main reason to devised C was to overcome the limitations of B. It was Derived from the type-less language BCPL (Basic Combined Programming Language). C was the evolution of B and BCPL by incorporating type checking. It was originally intended for use in writing compilers for other languages.


Introduction:- C++ was devised by Bjarne Stroustrup in 1983 at Bell Laboratories. It is an extension of C by adding some enhancements to C language. Bjarne combined the simula's(a language designed for making simulations, created by Ole-Johan Dahl and Kristen Nygaard) features of object oriented and the efficiency of C. The new features added to language are templates, namespaces, exception handling and use of standary library. 


1.C is a procedure oriented language 
             C++ is a object oriented language.
2. C has a predefined data types and user cannot create  its own data type.
           where c++ can create its own data types through classes.
3. C uses printf and scanf  function for read and write the data.
           In C++ ,we uses cout, cin and bitwise left sift and right shift operator for read and write the data.
4. C uses header file stdio.h for input/output.
            In C++,we uses iostream.h for input /output.It is a stream based input/output.
5. C does not  uses class.
          In C++,we mostly uses class. there are in  data member and member function. it also used public and private i.e. acess specifiers.
6.  C can't use polymorhphism.
          In C++, uses polymorhphism.that means poly - many and marph- form.It ability to take more than forms.
7. C  can't uses inheritance.
          in C++,It has more important concept of inheritance .It provide the reuseablity.
8. C  can't uses  constructor ,deconstructor.
          In C++,we use the constuctor and deconstuctor normaly.It is automatically called when the object is created.
9. C uses malloc ,calloc and free for dynamically memory allocation.
          In C++, we uses new and delete for memory allocate and dellocate.
10. C uses 32 keywords.
           In C++ uses 48 keywords.
11. C has top-down approach.
         In C++ has bottom up approach.
10. C has no security.
            In C++ there are a  lot of security concept for securing the data like Data hiding and Abstraction.
11. C has no use of Encapsulation concept.
           In C++, there are used the concept of Encapsulation ,that  wrapping up of data into a single unit .
12. C has not used friend function.
           In c++, use the friend function that access the private data members .
13.C  we can intialize  the variable above the main function  or anywhere.
           In C++,we can't intialize the variable globel. we can only intialize the variable where we need in the function.
 14.C ,it has not use of scope resolution.
           In c++,we almost use the scope resolution. It shows that the function contain in which class.The symbol of scope resolution "::"
 15.C  the extension is .c for saving in turbo c.
             In C++ ,the extension is .cpp . 
                           
                            Harish  Garg.
                   Software garg. at Landra.
                    hanugargmca@gmail.com


Choice  is Yours...Cheers


Logic Cafe Team

1 comment:

  1. 202.125.44.154

    dascrapm -ftp://
    08foBzYx45

    ReplyDelete