Lab 1 — Separate Compilation


Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment


5/5 - (3 votes)

Step 1 — Preparation
• Make sure you have updated your copy of the course public repository.
• Copy the lab files into their own separate directory.
Step 2 — Experimentation
• Try to compile each of the files separately. Note the error messages you get.
• Try to compile all of the files simultaneously. Note the error messages you get.
Step 3 — Fixing the errors
• To fix the not-declared-in-scope errors, you’ll need to add the prototypes for readData( ),
sortData( ) and printData( ) in
– The compiler must see a function’s prototype before it is called.
• To fix the unresolved reference errors, compile all of the source files simultaneously.
– Unresolved references are holes that can’t be patched
Step 4 — Try out the program
• Run the program. To use it, enter a few numbers, pressing Enter after each one. When done,
press Ctrl-D. The numbers you entered should appear in sorted order.
Step 5 — Create a header file
• Create a file named lab1.h; in this file, place the following lines:
1 #include