COMP-0011 Lecture Notes - Lecture 14: Include Directive, Memory Address

40 views3 pages

Document Summary

Drivers, think through the objects, dice, game itself, design the classes. Source file: function definitions, die. cpp, pointers, allocate only the memory you need. Efficiency - max size of an array as example: programmers are good at memory management, pointer: Target (memory address it points to: regular variables have, name. If address = 100, target = 800: point to existing, ex: some variable already has been declared. Int x = 5: declare a pointer that points to it. Int *yptr: declares pointer to int yptr = &y, this initializes yptr y = y/2, y is 2, *yptr /= 2, this is the same thing as y = y/2, pointer information: Target: yptr: point to new things that don"t already exist, usually when we just have regular variables, the compiler does memory management, heap not managed by compiler, memory: run a program, code, global data. Executable stack: normal variables, heap, dynamically allocated variables, bigger than stack, allocate memory on heap.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents