ecco... ricordavo che qualcosa non andava..
incompatible time of argument 1 of mktime
codice:
time_t get_date()
{
struct tm data;
int i=0,j=0,righe=1;
char str[18];
char *v_ora,*v_data;
while(righe<4) //scarto le prime tre righe
if(buffer[i++]=='\n') righe++;
while(buffer[i] != '\n') str[j++] = buffer[i++];//leggo tutta la riga relativa alla data e ora
str[j++]='\0';
//tokenizzo la stringa e memorizzo la data nella struct
v_data = strtok(str," ");//ho letto la data
v_ora = strtok(NULL," ");//ho letto l'ora
data.tm_mday = atoi(strtok(v_data, "/"));
data.tm_mon = atoi(strtok(NULL, "/"));
data.tm_year = atoi(strtok(NULL, "/"));
data.tm_hour = atoi(strtok(v_ora,":"));
data.tm_min = atoi(strtok(NULL,":"));
return mktime(data);
}
tra l'altro mi chiedevo.. che tipo è in definitiva un time_t? con quale specificatore lo stampo con la printf per avere un riscontro (per un debug veloce)???