Koofers

Lecture Notes for CS 2605 - Data Structs & OO Development at Virginia Tech (VT)

Notes Information

Material Type:Class Note 1
Professor:Staff
Class:CS 2605 - Data Structs & OO Development
Subject:Computer Science
University:Virginia Polytechnic Institute And State University
Term:Spring 2008
Keywords:
  • Global Variable
  • Memory Leaks
  • Declaration
  • Constructor
  • Default Values
  • Copy Constructor
  • Implementation
  • Local Variable
  • Development
  • You Have...
Login / Sign Up to View Document
Preview Page 1Preview Page 2Preview Page 3

Sample Document Text

Stuff you need at the top of any C++ program is: #ifndef HEADER_H #define HEADER_H At the end, you then have to put: #endif The .cpp file needs to #include “header.h” Only need copy constructor/ assignment operator if there is dynamic content You only need to create your own assignment operator if you need deep copy support – if the class deals with pointers or arrays. Otherwise the shallow copy support given by default will be enough – it copies the data members from one object to the other. Signed int allows negative values. Unsigned int only allows 0 and positive values, allowing twice the amount of positives. Dangling pointer – pointer without a target Memory leak – have memory with no pointer storing its address A dangling pointer hold an address that the program does not have proper ownership of. A memory leak occurs when the program retains ownership of an address, but no longer has a pointer or reference storing that address and so cannot access that location. When objects are destroyed th...

Related Documents

Double Value Notes
Double Value Notes
Initialization Notes
Initialization Notes
Initialization Notes
Initialization Notes
Initialization Notes
Following Command Lines Notes
Default Parameter Exam
Current Number Exam
Global Variable Exam
Complicated Exam
Complicated Exam
Implementation Notes
Question of Value Exam
Correct Result Notes
155, "/var/app/current/tmp/"