Hi, everyone. I'm self-teaching C and I want to post my answers to the questions in my book so that you can correct me. Please peruse my answers and tell me what you think.
1. Does your compiler do both the linking and compiling with just one command, or do you have to enter separate commands?
My compilers (gcc and clang) each do compiling then linking with one command.
2. What extension should you use for your C source files?
3. Is FILENAME.TXT a valid name for a source file?
Yes, but it is against convention and doesn't describe its content, so it's a bad choice of filename.
4. If you execute a program that you have compiled and it doesn't work as you expected, what should you do?
Figure out where the bug is - which might involve simply reading the code and conducting a thought experiment, or might involve more complicated debugging techniques. Then edit the source code, recompile and retest.
5. What is machine language?
It is the set of instructions that the CPU of the computer executes. It is specific to a CPU architecture (whereas C is portable). Executable files typically contain machine language.
6. What does the linker do?
It converts object code into an executable. It allows me to combine multiple source files into one big program.