int shmid = shmget(IPC_PRIVATE, sizeof(int)*sizeof(arr), 0666|IPC_CREAT); int* shm = (int*) shmat(shmid, (void*)0, 0); for(int i=0; i<1; i++){ *(shm+i) = a