Construct a library Time that contains the time-conversion functions (given a number of seconds, returns the equivalent number of minutes; given the number of minutes, returns the equivalent number of hours; given the number of hours, returns the equivalent number of days; given the number of seconds, returns the equivalent number of days). Write a driver program to test your library.© BrainMass Inc. brainmass.com March 4, 2021, 6:08 pm ad1c9bdddf
First compile the library file
gcc -c myTime.c
this will create myTime.o
then simply do
gcc -o test testTime.c myTime.o
remember that the header file myTime.h containing the signatures of the functions should be included in your test driver file
Here is the code file
/* To compile the functions into a library ...
Three source code files will show you how to write appropriate functions to convert different time scales/metrics. This can be useful in
a) code to write software clock or watch
b) understanding of how to use multiple files for a single project
c) understanding of the use of header files
This will show how to compile multiple files into one executable file.