0
4

1 回答 1

1

Use a pointer, not value

ClientList* shared_memory;
     here ^

shared_memory = (ClientList* ) shmat (segment_id, 0, 0);
                  and here ^

Ah, and then your sizeof will look like this

const int shared_segment_size = sizeof(ClientList);
于 2012-11-30T10:53:23.497 回答