speciality of C

Discussion in 'C' started by srinivasa murthy M B, Jul 12, 2007.

  1. srinivasa murthy M B

    srinivasa murthy M B New Member

    Joined:
    Jul 12, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    What is there in c- programming that is not there in c++....
    that is speciality of c...
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    I don't see a similarity between the 2 apart from C++ supports the C language syntax. I guess you have misframed the question.
     
  3. munkyeetr

    munkyeetr New Member

    Joined:
    May 4, 2007
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Victoria BC, Canada
    c++ is a superset of c, hence c++ (an increment of c). Now, I believe that any valid c program can be compiled with a c++ compiler, but it doesn't work the other way around. c++ has features that c does not support.

    Anyone, please correct me if I am wrong.
     
  4. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    http://www.daweidesigns.com
    C++ is not a strict superset of C. C++ has stricter typing and rules. In C it is perfectly valid to call a function before it has been defined, even if it has not been declared (prototyped). The compiler will assume that it takes an int as an argument, and returns an int. A C++ compiler will reject that. There are a number of other examples. The treatment of structures and the conversion of pointer types, for instance.
     
  5. munkyeetr

    munkyeetr New Member

    Joined:
    May 4, 2007
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Victoria BC, Canada
    Thank you for the correction DaWei.
     
  6. sharma_atul13

    sharma_atul13 New Member

    Joined:
    Jul 16, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    I think that the speciality of C is that it has inspired to develop C++ as to make a more user friendly language with the help of introducing inheritance and other object oriented concepts.

    Plz correct me if I am wrong somewhere???
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice