Thread: Advantage of C to C++

  1. #16
    Registered User Draco's Avatar
    Join Date
    Apr 2002
    Posts
    463
    Object Oriented programming is only a style, but there are languages such as C++ which have tailored themselves to that style, making it exponentially easier to program, ex. the entire class structure.

  2. #17
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    If you're programming on microcontrollers and the like, you are more likely to be using C than C++ (as it is, I believe, considered too bloated for such applications), but perhaps someone with more experience with this can elaborate.
    It's not because C++ is too bloated. It's just that it's easier to create a C compiler than a C++ compiler, and since embedded programs are typically small - no one complains

  3. #18
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Quote Originally Posted by bithub
    It's not because C++ is too bloated. It's just that it's easier to create a C compiler than a C++ compiler, and since embedded programs are typically small - no one complains
    The size and memory usage of a C++ progarm compared to a similar C program is larger on both cases (most of the time). So there are times when it comes down to needing a smaller package. Considering the vast number of platforms that GCC can compile to (even doing cross platform compiling) its not that hard to write a C++ program for an embedded system.

  4. #19
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > I have heard that C++ is almost a superset of C.
    C++ is a semantic superset of C (all the concepts of C are also in C++).
    C++ is not however a syntactic superset of C. Not all valid C programs can be compiled as C++, and not all valid C programs which can be compiled with C++ will produce identical results.
    http://david.tribble.com/text/cdiffs.htm
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Speed/size advantage to SQL?
    By MK27 in forum Tech Board
    Replies: 15
    Last Post: 06-26-2009, 11:28 AM
  2. advantage of a hash table
    By alyssa in forum Linux Programming
    Replies: 3
    Last Post: 03-02-2009, 09:04 AM
  3. Advantage of C in computer graphics?
    By NoobieGecko in forum C Programming
    Replies: 8
    Last Post: 08-29-2008, 04:55 PM
  4. taking advantage of hyperthreading?
    By doubleanti in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 08-21-2006, 11:49 PM
  5. Advantage to having IP-only access to the boards...
    By -KEN- in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 08-31-2002, 07:27 PM