• TopRamenBinLaden@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    9
    arrow-down
    3
    ·
    edit-2
    1 year ago

    C++ is a superset of C, and C is a subset of C++. C++ was originally designed for the purpose of updating and adding OOP to C.

    The main things C++ has that C doesn’t are user defined data types, support of reference variables, function overloading/overriding, built in exception handling with try/catch, inline functions, and C++ has around 30 more keywords overall.

    I would say the biggest difference is the OOP focus of C++ where all of data and functions are encapsulated into an object. This helps make C++ more secure and better for writing high level implementations than C.

    • dylanTheDeveloper@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      1 year ago

      Ahh so the whole create a object from a class thing actually works in native C++. So I can create child classes aswel and do cool stuff like casting.

      Don’t laugh okay I thought C++ through Unreal Engine was vastly different from native C++ (because that’s what I learnt first)

      Never actually used classes when I was playing with native C++. Couldn’t think of anything simple to make that would require it