Working with shared memory for the first time, my project is to have readers and writers access shared strings and modify or read them, etc. I know that malloc doesn't work but not sure how to attach a 2d string array to memory, i keep getting this from the compiler:
warning: assignment makes integer from pointer without a cast
int array_id; // id for the shared memory segment
char records[10][50]; // the shared memory segment array
// attach the reader to the shared segment
fread(&newrecord, sizeof(id_record), 1, id_file);
array_id = newrecord.id;
printf("%d\n", array_id);
records[0][0] = (char**) shmat(array_id, (void*) 0, 0);
if (records[0] == (void*)-1) {
perror("Array Attachment Reader");
}
arrayid is correct i've triple checked it don't bring it up.
thanks