Hi all,
I have a problem with my code.

I use in a struct variable type time_t with name tt

typedef struct{
  time_t tt;

then I initialise in the main function of my server

time_t timer;

I pass the timer in my shared memory


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 ?

Recommended Answers

All 3 Replies

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.