ECS 36B Lecture Notes - Lecture 9: Include Directive, C Standard Library, Uptodate
ECS 36B verified notes
9/26View all
Document Summary
Dividing files into multiple files helps with the organization of the overall project. More usable because different files become libraries. Need to break up the program between source files and header files. Main. c contains a series of function calls. Compiler does not see the difference in a header file or c file. If you include c file more than once, will have double declaration errors, that"s why we have . h. **when you rename a guard name in c lion, it won"t change it in the makefile** Have to remember to do this manually. This could become time-consuming when compiling a large file. If you have hundreds of files together. Could compile all the . c files into one . io file. Update rule: the rule you want to make it up-to-date. Makefiles by hand is hard to do. Instead, we are using cmake (c stands for cross-platform) Addexecutable line includes all source files, takes care of dependencies for you.