localtime question
Mipam
mipam at ibb.net
Tue Aug 10 07:49:27 PDT 2004
Hi,
I tried to display the time from yesterday by this little program
#include <stdio.h>
#include <sys/time.h>
time_t tval;
int main()
{
struct timeval tv;
struct timeval tv_current;
if (gettimeofday(&tv_current, NULL) == -1)
err(1, "Could not get local time of day");
tv.tv_sec = tv_current.tv_sec-86400;
printf("%s\n", ctime(tv.tv_sec) );
}
But at compilation it complains:
tijd.c: In function `main':
tijd.c:15: warning: passing arg 1 of `ctime' makes pointer from integer
without a cast
What am i doing wrong?
Bye,
Mipam.
More information about the freebsd-questions
mailing list