time program showing time since epoch?
Hi all, for a tutorial we have been given the task of demonstrating a time program that was discussed in a lecture. However when I convert from the slide to try and compile it, there are many errors - many due to which there are too many spaces in between some of the functions - However there may be other parts missing.
Before this code on the same slide there this explanation:
#include <time. h>
#include <stdio. h>
#include <unistd. h>
int main( )
time_ t the_ time;
for( i = 1; i <= 10; i++)
the_ time = time(( time_ t *) 0);
printf(" The time is %ld\ n", the_ time);
returns the number of seconds since epoch
time_t time(time_t *tloc);
also write the returned value to a location pointed to by tloc, if this isnít a null pointer.
Can anybody help with why it wont compile?