You must Sign In to post a response.
  • Category: Software

    What is the difference between C and C++?

    What is the main difference between C and C++?
  • #71058
    Hi,

    C is a structure oriented language where the code is organised in the form of blocks of codes that are executed to achieve the resultant output. The blocks of code can be functions, structure etc. It follows procedure paradigm.

    Whereas, C++ is an object oriented language where the coding is done by using the user defined objects. Objects in turn are instances of class. Classes are based on the concept of data abstraction where all the related data and functions are grouped together and during execution instances of these classes called objects are used to refer to the data inside its respective class.

    This is the main difference between C and C++. Apart from this other common differences are:
    1. C files are stored with an extension '.c' whereas C++ files are stored with '.cpp'.
    2. C is a low level language and is less user friendly where as C++ is a middle level language and is easily interpretable by the machine and is more user friendly too.
    3. The execution in C is from top to down where as that in C++ is from bottom to up.
    4. We cannot do overloading with C where as C++ supports both function and operator overloading.

    Thanks & Regards,
    Akanksha P.V
    Lead Editor(Ask Expert)

  • #71104
    ->C is Procedure Oriented Programming Language (POP).
    ->C++ is Object Oriented Programming Language (OOP).


    ->C is mostly used to develop system software.
    ->C++ is mostly used to modal real life problem to program and use to develop application programs.


    ->C program has extension .C
    ->C++ program has extension .cpp

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

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

    Regards,
    Kothari Keval
    "Sharing Knowledge Is My Aim"

  • #71191
    Both of them are computer languages. Object oriented C is called C++. Object oriented programming means a programming which have the concept of objects. Any thing that can be defined is called an object. In C++ we can describe any values. In C it is impossible. C++ is the developed form of C. C evolves from B and B evolved from BASIC. C is function oriented. All these peculiarities makes difference in both the programming languages.
    Think before act.

  • #71506
    Hello,

    C++ is object oriented language which is based on Objects and having private mode of data accessing whereas C allows structure formation using public mode. the new concept of inheritance, abstraction, data hiding etc are not there in c language.

    I am providing a link of article through which you can know the Difference between c and c++ in full detail.

    Chirag Sachdeva

  • #71917
    HI,

    C and C++ are the computer languages used for the programming concepts. The differences between C and C++ are noted below:

  • C is the procedural oriented language, where as C++ is an Object oriented language
  • The default header file used in C language is stdio.h and in C++ it is iosteam.h
  • C language does not support the OOPS concept, but C++ is based on the OOPS concept.
  • Programs written in C are stored with the extension .c and the programs written using C++ are stored with the extension .cpp
    Regards,
    Jagannathan S
    ISC Member

  • #71985
    C and C++ are high level languages.
    -> Unlike C, C++ is an object oriented language, i.e., it has class structures.
    -> C file has extensions .c whereas C++ files has extensions .cpp
    -> C files use stdio.h whereas C++ use iostream.h as standard header files
    -> The I/O commands for C are scanf & printf, and for C++ are cin and cout.
    -> C supports GTK tool whereas C++ supports Qt tools for GUI programming.

  • #72049
    Hello Ankit, One point you made here is wrong. C is not an object oriented language. It is a Procedure-oriented language. You said that both C and C++ are OO languages. Other points are correct.
    With Regards
    Roshin

  • #72158
    Hello Roshin, I didn't mention that C is an OO language. Please look at the sentence carefully. I said Unlike C - not like C, C++ is an OO language.

  • #72166
    I want to make one change in my explanation. As pointed out by Mr. Roshin that C is a procedural language and not object oriented. Thanks for the correction.

    C++ is high level programming language. It come under the category of OOP's i.e Object oriented programming languages. Where as C is a procedural language.
    But since the question is about the differences between both the languages.
    * C language was developed in AT & T bell laboratories. While C++ is the higher version of C with GUI(Graphics user interface) features developed by B. Stroutstrup.

    * C++ has also some special features which were not present in C. For example: GUI programming tools.

    * C++ provides the concept of Data hyding as it supports the classes where as C does not provide any such concept of data hyding as it does not support classes.

    * C++ provides different data visibility modes : Public, Private, and Protected. Where as C does not have different visibility mode to store data. It stores data in a default mode irrespective of the data type.

    * C does not support any features of Inheritance. Inheritance is one of the special characterstics of inheriting functions and other features of one class to another class. C++ provides this feature.

    * It's operating commands are different from that of C++. For example: printf(), scanf() in C and cout, cin in C++ to perform the same function of output and input respectively.


    There are many other differences in C and C++. And after pointing out so many differences, it is clear that C++ is very good programming language.

    Regards,
    Ankit Sharma

    "Fragrance of flowers spreads only in the direction of wind, but the goodness of a person spreads in all direction."

  • #72199
    Hello Ankit Agarwal, I didnt mention about your post. I tried to point out the mistake by Ankit Sharma. He early posted that--Both C and C++ are OO language. But he later changed it.Dont know where it gone--early it was above my post.Now it came below to me, I think he edited it. See, he came with the explanations.

    Editors, I pointed out a mistake in an answer. And for that no points ? What an editing here ?

    With Regards
    Roshin

  • #72713
    C and C++ Both is programming language.
    Difference between them are:-
    1) C is a non object oriented or object base language but c++ is object base language.
    2) WE use for Structure programming concept in c. and We use Class programming concept in C++.
    3)We unable to reuse code of c language, whenever in c++ we can reuse the code of c++ language.
    4)C is the father of C++.
    5)To save file we use .c in c whenever in c++ we use .cpp.
    6)C++ is more powerful language instance of c.


  • Sign In to post your comments
    Submit New Thread
    Return to Return to Ask Experts Section