something abt time()
| CD4 (28) |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
#include <time.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.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);
}
|
in this example i dint get line 9 time((time_t *)0);
can please some1 help.Code is from the book Beginning linux programming 4th ed.
regards
|
|
|
| CD4 (28) |
|
so bazzy... cant time(NULL) be used aas in example?? what is the significance of the lines coded above (type casting)??
regards
|
|
|
| Bazzy (6258) |
|
|
There isn't any difference so you can put that.
|
|
|
| CD4 (28) |
|
|
thanks bazzy... :)
|
|
|
Topic archived. No new replies allowed.
|