C Flashcards
What are C programs are compiled into?
Object code.
What is gcc?
The GNU Compiler Collection is an open source C compiler.
What is the default executable name produced by gcc?
a.out
How can you specify the executable name produced by gcc?
Using the -o switch.
What does cpp stand for?
cpp is the C preprocessor.
When does cpp examine source code, relative to compilation?
Source code is examined by cpp prior to compilation.
cpp must be called separately from gcc.
False, gcc calls cpp automatically.
What does the following line do?
cpp hello.c
By default, independent invocations of cpp prints the rewritten source code to the screen.
How are cpp directives distinguished from regular C code?
A leading # symbol.
Macros are pure textual substitutions, typically used for defining what 2 things?
Constants, and very simple functions in compact form.
What would occur if gcc encountered a #include directive?
It would produce an invalid error syntax.
In what way are standard header files included differently than user defined header files?
Using <file>, instead of “path”.
Why is no additional path information included with standard header file names?
Because these are located in pre-defined folders that cpp and the compiler will always search.
Can operating systems or platforms define their own standard header files?
Yes.
What about the C compilation process makes header files necessary?
C compilation is a line by line process that will generate errors if a not previously defined identifier is encountered.
Source files are compiled interdependently.
False, they are compiled independently, which further reinforces the need for header files.