C++
From StudyWiki
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
- C++ provides
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
- C++ is more type safe than C
- C++ supports objects and object orientated concepts
- makes other improvements to C language
Important C++ Libraries
- Standard C Library
- Standard C++ Library
- incorporates many classes from Standard C Library
- STL (Standard Template Library)
- containers and generic algorithms
Memory Model
- local variables normally allocated on the stack
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
- copied by value
- to provide reference semantics for assignment:
- pointer and reference data types are provided
