C++

From StudyWiki

Jump to: navigation, search


Contents

Overview

  • an object orientated programming language
  • invented by Bjarne Stroustrup in early 1980s at Bell Lab
    • first called "C with classes"
  • constantly evolving, although now standardised
  • design goals:
    • backwards compatible with ANSI C
    • object orientated capability
    • efficient running speed
      • use native code and little/no runtime error checking
    • simple syntax



Benefits of C++

  • large installed code base
  • available on many platforms
  • powerful object orientated and abstraction features
  • interface easily with hardware and/or other languages
  • efficient


Comparison with C


Important C++ Libraries



Memory Model




Parameter Passing

  • when a variable is assigned to another one
    • copied by value
      • a completely new copy of the entity is made
      • this includes objects
  • to provide reference semantics for assignment: