Previous Lecture | Lecture 11 | Next Lecture |
Lecture 11, Thu 02/13
Makefiles, C++ Memory model - heap vs. stack
Premlimaries to Makefiles
- Basics of code compilation in C++ (review)
- Makefiles (used to automate compilation of medium to large projects)consisting of many files
- We will start by using a makefile to compile just a single program
- Extend to the case where your program is split between multiple files
- Understand what each of the following are and how they are used in program compilation
- Header file (.h)
- Source file (.cpp)
- Object file (.o)
- Executable
- Makefile
- Compile-time errors
- Link-time errors
Automating compilation using makefiles
- read about Makefile
- Compile-time errors
- Linker errors
- Header guards
- Refer to Professor Wang’s detailed notes on makefiles: https://ucsb-cs32.github.io/f19/lectures/lect01/
C++ Memory Model: Heap vs. stack
- Dynamic memory allocation: new and delete
- Stack vs. heap