Hi all,
I have a problem with my code.
I use in a struct variable type time_t with name tt
like
typedef struct{
time_t tt;
}
then I initialise in the main function of my server
time_t timer;
timer=time(NULL);
I pass the timer in my shared memory
shared_parking[parking_id]->tt=timer;
I send the stucture and then I try to print time in my client
printf("\t\tLast Reservation Time: %s\n",asctime(localtime(&parking_msg.data_index.data.tt)));
But I take a segmentation fault.
Also when I compile client I take a warning
client.c:571:4: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘int’
What is wrong ?