Memory Access Summary

Here is a list of the most important points that we have raised about memory access.

  • The operators new and delete give the C++ programmer increased power as well as increased responsibility.
  • Improper use of pointers and dynamic memory can cause program crashes that result from heap corruption and memory leaks.
  • Qt and STL container classes permit the safe use of dynamic memory without adversely affecting performance.
  • In a multiple variable declaration, the unary * operator applies only to the variable that immediately follows it, not the type that precedes it.
  • Dereferencing an uninitialized pointer is a serious error that may not be caught by the compiler.
  • After delete has been applied to a pointer, the state of that pointer is undefined.
  • It is good practice to assign NULL to a pointer immediately after it has been deleted.
  • Applying delete to a non-null pointer that was not returned by new produces undefined results.
  • The compiler cannot be relied upon to detect the improper use of delete, so it is the programmer's responsibility to use delete correctly.
  • A memory leak is produced when a program causes memory to be allocated and then loses track of that memory so that it can neither be accessed nor deleted.


Part I: Introduction to C++ and Qt 4

C++ Introduction

Classes

Introduction to Qt

Lists

Functions

Inheritance and Polymorphism

Part II: Higher-Level Programming

Libraries

Introduction to Design Patterns

QObject

Generics and Containers

Qt GUI Widgets

Concurrency

Validation and Regular Expressions

Parsing XML

Meta Objects, Properties, and Reflective Programming

More Design Patterns

Models and Views

Qt SQL Classes

Part III: C++ Language Reference

Types and Expressions

Scope and Storage Class

Statements and Control Structures

Memory Access

Chapter Summary

Inheritance in Detail

Miscellaneous Topics

Part IV: Programming Assignments

MP3 Jukebox Assignments

Part V: Appendices

MP3 Jukebox Assignments

Bibliography

MP3 Jukebox Assignments



An Introduction to Design Patterns in C++ with Qt 4
An Introduction to Design Patterns in C++ with Qt 4
ISBN: 0131879057
EAN: 2147483647
Year: 2004
Pages: 268

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net