C++-overview4 - An Overview of C+ Douglas C. Schmidt C+...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
An Overview of C++ Douglas C. Schmidt Professor Department of EECS [email protected] Vanderbilt University www.dre.vanderbilt.edu/ schmidt/ (615) 343-8197 September 1, 2004 An Overview of C++ Douglas C. Schmidt C++ Overview early 80’s The original cfront translated C++ into C for portability However, this was difficult to debug and potentially inefficient Many native host machine compilers now exist e.g. , Borland, DEC, GNU, HP, IBM, Microsoft, Sun, Symantec, etc. C++ is a mostly upwardly compatible extension of C that provides: 1. Stronger typechecking 2. Support for data abstraction 3. Support for object-oriented programming 4. Support for generic programming Vanderbilt University 1 An Overview of C++ Douglas C. Schmidt C++ Design Goals As with C, run-time efficiency is important Unlike other languages ( , Ada) complicated run-time libraries have not traditionally been required for C++ Note, that there is no language-specific support for concurrency, persistence, or distribution in C++ Compatibility with C libraries and traditional development tools is emphasized, , Object code reuse The storage layout of structures is compatible with C , support for X-windows, standard ANSI C library, and UNIX/WIN32 system calls via extern block C++ works with the make recompilation utility Vanderbilt University 2 An Overview of C++ Douglas C. Schmidt C++ Design Goals (cont’d) “As close to C as possible, but no closer” i.e. , C++ is not a proper superset of C backwards compatibility is not entirely maintained Typically not a problem in practice. .. Note, certain C++ design goals conflict with modern techniques for: 1. Compiler optimization , pointers to arbitrary memory locations complicate register allocation and garbage collection 2. Software engineering , separate compilation complicates inlining due to difficulty of interprocedural analysis Dynamic memory management is error-prone Vanderbilt University 3
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
An Overview of C++ Douglas C. Schmidt Major C++ Enhancements 1. C++ supports object-oriented programming features e.g. , abstract classes, inheritance, and virtual methods 2. C++ supports data abstraction and encapsulation , the class mechanism and name spaces 3. C++ supports generic programming , parameterized types 4. C++ supports sophisticated error handling , exception handling 5. C++ supports identifying an object’s type at runtime , Run-Time Type Identification (RTTI) Vanderbilt University 4 An Overview of C++ Douglas C. Schmidt Important Minor Enhancements C++ enforces type checking via function prototypes Provides type-safe linkage Provides inline function expansion Declare constants that can be used to define static array bounds with the const type qualifier Built-in dynamic memory management via new and delete operators Namespace control Vanderbilt University 5 An Overview of C++ Douglas C. Schmidt
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/08/2011 for the course CS 101 taught by Professor Jitenderkumarchhabra during the Summer '11 term at National Institute of Technology, Calicut.

Page1 / 11

C++-overview4 - An Overview of C+ Douglas C. Schmidt C+...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online