I want to allocate shared memory as a 2D array using IPC. I tried the following:
id_shmem = shmget(ipc_key, sizeof(int)*rows*columns, IPC_CREAT|0666);
matrix = (int **)shmat(id_shmem, 0, 0);
The problem is that whenever I try to write something into the matrix, I get a segment fault.