0

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 ?

3
Contributors
3
Replies
5
Views
5 Years
Discussion Span
Last Post by Narue
0

Please post more code. Ideally it would be a complete (SHORT!) program that we can cut, paste, and compile as-is and see the error.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.