Notices
Results 1 to 10 of 10

Thread: Is C a subset of C++?

  1. #1 Is C a subset of C++? 
    Forum Freshman
    Join Date
    Apr 2008
    Posts
    61
    I know C, and I also know some C++, and I think all of C can be used in C++, but not vice versa. So, I have to ask, is C a subset of C++?


    Reply With Quote  
     

  2.  
     

  3. #2  
    Forum Sophomore CShark's Avatar
    Join Date
    May 2008
    Location
    East Coast of Canada
    Posts
    192
    The short answer is Yes, C is a subset of C++. It's really the other way round, C++ being an Object Oriented version of C. Once you start coding in C++, you see (no pun intended) how powerful and simpler C++ is.


    Reply With Quote  
     

  4. #3  
    Forum Freshman
    Join Date
    Apr 2008
    Posts
    61
    I think you're right. I took some courses in both languages a few years ago, and C++ is a superset of C. I belong to the school of thought that says that you should learn C before learning C++.
    Reply With Quote  
     

  5. #4  
    WYSIWYG Moderator marnixR's Avatar
    Join Date
    Apr 2007
    Location
    Cardiff, Wales
    Posts
    5,760
    C came first, and C++ is an object orientated improvement on C (the name C++ is actually a geek joke, meaning C = C + 1, geddit ?)
    "Reality is that which, when you stop believing in it, doesn't go away." (Philip K. Dick)
    Reply With Quote  
     

  6. #5  
    Forum Sophomore CShark's Avatar
    Join Date
    May 2008
    Location
    East Coast of Canada
    Posts
    192
    er....yeah, C++ did come after C. As for learning which first, trying to understand C++ before C may be a bit more than you can chew. You may wish to start with basic (any flavour will do) before moving to C.

    Read up on OOP as well (as previously mentioned). We can do the compiler-wars at that stage!
    Reply With Quote  
     

  7. #6  
    Forum Freshman
    Join Date
    Apr 2008
    Posts
    61
    I never took a course in Basic, but I have read some of the language a while ago, and I think it's neat.
    Reply With Quote  
     

  8. #7 learning 
    New Member
    Join Date
    May 2008
    Location
    London, City
    Posts
    3
    If you have not yet learnt either, then I would strongly recommend to go straight into C++ without learning C first. While it is true that C++ is a superset of C, and that virtually any legal C program is a legal C++ program, the leap from C to C++ is very significant. C++ benefited from its relationship to C for many years, as C programmers could ease into their use of C++. To really get the full benefit of C++, however, many programmers found they had to unlearn much of what they knew and learn a whole new way of conceptualizing and solving programming problems.

    reference: http://newdata.box.sk/bx/c/
    Reply With Quote  
     

  9. #8 Re: learning 
    Forum Sophomore CShark's Avatar
    Join Date
    May 2008
    Location
    East Coast of Canada
    Posts
    192
    Quote Originally Posted by ExecuZen I.T.
    If you have not yet learnt either, then I would strongly recommend to go straight into C++ without learning C first. While it is true that C++ is a superset of C, and that virtually any legal C program is a legal C++ program, the leap from C to C++ is very significant. C++ benefited from its relationship to C for many years, as C programmers could ease into their use of C++. To really get the full benefit of C++, however, many programmers found they had to unlearn much of what they knew and learn a whole new way of conceptualizing and solving programming problems.

    reference: http://newdata.box.sk/bx/c/

    I disagree. Having gone the C to C++ route, once I understood how objects worked, the rest was simple, because I had a good foundation in C.

    Imagine trying to understand x == 10 ? y = 16 : y = 5; if you have never coded before. Trying to grasp syntax is one thing, applying it is another. As C is a subset, it makes sense to start 'small' and work your way up.
    Reply With Quote  
     

  10. #9  
    Forum Freshman
    Join Date
    Apr 2008
    Posts
    61
    As C is a subset, it makes sense to start 'small' and work your way up.
    Agreed. But I say that partly because that was the route I took - first I took Pascal, then C, then C++.
    Reply With Quote  
     

  11. #10  
    Forum Sophomore CShark's Avatar
    Join Date
    May 2008
    Location
    East Coast of Canada
    Posts
    192
    Quote Originally Posted by LegalEagle
    As C is a subset, it makes sense to start 'small' and work your way up.
    Agreed. But I say that partly because that was the route I took - first I took Pascal, then C, then C++.
    Indeed. My reasoning was the same.

    Never got into Pascal, except having to learn to declare a function when first picking up 'C' (Is that not originally from Pascal....?)
    Reply With Quote  
     

Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •