(CSP31A) C++ Programming I
User-defined header files
#include "filename"
Static linking
- Linked at compile time - Linked at load time - Copy all the library routines into the executable image
Dynamic linking
- Linked at run time - Perform code sharing
What is true about the preprocessor?
- Pre-processor directives begin with the hash symbol - Includes any files into the source code before compiling - Tells the compiler to preprocess the source code before compiling
The linker
A program in a system which helps to link an object's modules of program into a single object file
What is a source code file?
A text file in a specific syntax
Macros
Always proceeded by #define
Relocatable machine code
Can be loaded and ran at any point
What are the standard libraries?
Common functions, whose definitions have been written, and are ready to be used in any program
Header file
Contains definitions of pre-defined functions like cout
Loader/linker
Converts the relocated code into absolute code
Conditional compilation
Directives which help compile a specific portion of the program or to skip compilation compilation of some specific part of the program based on some conditions
Pre-processor directives
Macros, file inclusion, conditional compilation, and other directives
Assembly language
Neither in binary nor high level form
Assembler
Not universal, since we have one for each platform
Pre-processors
Programs that process our source code before compilation
High level language
Refers to a programming languages such as C++
Pre-processor
Removes all the directives and performs file inclusion, macro-processing, and performs conditional compilation
What are the types of linking?
Static/dynamic
File inclusion
Tells the compiler to include a file in the source code
Absolute machine code
The executable file
Other directives
The material doesn't discuss these