A
Aaron
I'm trying to use timersub from sys/time.h. It looks like my source
code is correct but when I compile I get this warning:
gcc --std=c99 -c <file>
<file>.c:<line #>: warning: implicit declaration of function
'timersub'
From what I understand that means that timersub was not #included in
any header files. My abridged code is:
#include <time.h>
#include <sys/time.h>
int main () {
struct timeval *time_start, *time_end, *time_diff;
gettimeofday(time_start, NULL);
// Some stuff runs
gettimeofday(time_end, NULL);
timersub(time_start, time_end, time_diff);
}
Cheers!
Aaron
As a side question, how do use scanf with the contents of the time
code is correct but when I compile I get this warning:
gcc --std=c99 -c <file>
<file>.c:<line #>: warning: implicit declaration of function
'timersub'
From what I understand that means that timersub was not #included in
any header files. My abridged code is:
#include <time.h>
#include <sys/time.h>
int main () {
struct timeval *time_start, *time_end, *time_diff;
gettimeofday(time_start, NULL);
// Some stuff runs
gettimeofday(time_end, NULL);
timersub(time_start, time_end, time_diff);
}
Cheers!
Aaron
As a side question, how do use scanf with the contents of the time