using struct tm, time_t, and time to create a simple clock source code

This snippet submitted by Dieter Manstein on 2006-10-12. It has been viewed 11550 times.
Rating of 5.3 with 50 votes

#include <stdio.h>
#include <time.h>
#include <stdlib.h>

int main()
    struct tm *tmp;
    time_t s;
    tmp = localtime(&s);
    return 0;

More C and C++ source code snippets