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.
Code:
#include <time. h>
#include <stdio. h>
#include <unistd. h>
int main( )
{
int i;
time_ t the_ time;
for( i = 1; i <= 10; i++)
{
the_ time = time(( time_ t *) 0);
printf(" The time is %ld\ n", the_ time);
sleep( 2);
}
exit( 0);
}
Before this code on the same slide there this explanation:
Code:
#include<time.h>
time_t time(time_t *tloc);
returns the number of seconds since epoch
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?