Karteikarten
COMP 206 Unit 4: Data Abstraction
Karten in diesem Stapel (24)
- 1CStashprogramming tool that acts like an array but whose size can be established at runtime
- 2dynamic storage allocation-performing memory allocation manually by programmer
-allocated on heap
-allocate memory as program executes - 3C Dynamic Storage keywords-malloc()
-calloc()
-realloc()
-free() - 4malloc()-allocates block of memory to heap
-returns pointer
-takes single argument and doesn't automatically set storage area to 0
-allocates contiguous space of size bytes - 5calloc()-allocates requested memory
-takes two arguments that specify number of elements to be reserved, and size of each element in bytes
-returns pointer to beginning of allocated storage area
-storage area automatically set to 0 - 6realloc()-changes size of previously allocated block to size bytes
-returns pointer to new block - 7free()-returns block of memory pointed to by pointer that was previously allocated by calloc(), malloc(), or realloc() call
- 8C++ Dynamic Storage Keywords-new
-delete - 9new-allocates storage for variables and returns pointer
-invokes object's default constructor
-create new things out of heap - 10delete-complement of new
-applied to release any storage that is allocated with new
-return memory to heap
-takes pointer to object to be destroyed - 11object-variable
-region of storage
-place where you can store data
-operations can be performed on this data - 12encapsulationability to package data with functions
- 13abstract data typeallows us to abstract concept from problem space to solution space
- 14C++ Object-sovereign entity that can perform some task
-must have unique address - 15C++ Struct-structured piece of data
-has some address as object created directly after them - 16object's interface-declaration
-allows computer to enforce certain properties on object - 17object's implementation-definition of member functions
- 18header file-tells compiler what is available in library
-where interface specification is stored
-used to hold all declarations for functions - 19#defineused to create compile time flags
- 20#ifdef-tests label to see if it has been defined
-if true, code following will be included in package sent to compiler - 21#endifstops inclusion
- 22push()takes pointer to data you wish to store
- 23pop()returns data pointer from top of stack and removes top element
- 24peek()returns data pointer from top element, but leaves top element on stack
Informationen
- Beschreibung
- University-level C++ COMP 206 Karteikarten am COMP 206 Unit 4: Data Abstraction, erstellt von Adriana Vincelli-Joma am 08/09/2021.
- Erstellt von
- Adriana Vincelli-Joma
- Aufrufe
- 1
- Bewertung