Dear All, Please help me.
i can't run this program under linux.
I got :
calljam.c:19: warning: assignment makes pointer from integer without a cast
calljam.c:20: dereferencing pointer to incomplete type
...
...
It works under Windows but when i print L.DD, L.MM, L.YYYY it return number such 121367232732
the program:
Code:
/* File : calljam.c */
#include <sys/time.h>
#include <stdio.h>
typedef struct
{
int DD;
int MM;
int YYYY;
}date;
int main ()
{
date L;
time_t now;
struct tm *T;
now = time(NULL);
T = localtime (&now);
printf ("Jam = %d:%d:%d\n ",
T->tm_hour, T->tm_min, T->tm_sec);
printf ("Date = %d-%d-%d\n ",
T->tm_mday, T->tm_mon + 1, T->tm_year+1900);
printf ("local time %s\n", asctime (T));
L.DD = T->tm_mday;
L.MM = T->tm_mon + 1;
L.YYYY = T->tm_year + 1900;
printf ("Date = %d-%d-%d\n ", L.DD, L.MM, L.YYYY);
return 0;
}