Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

shared memory, problem with pointer

$
0
0
I've already finished my program and there is problem with pointer in this place:

int shmid;
int *buf
shmid = shmget(45281, sizeof(int), IPC_CREAT|0600);
27 if (shmid == -1){
perror("Utworzenie segmentu pamieci wspoldzielonej");
exit(1);
30 }
buf = (int*)shmat(shmid, NULL, 0); //Here is problematic line
33 if (buf == NULL){
perror("Przylaczenie segmentu pamieci wspoldzielonej");
exit(1);
36 }


Warning:Assignment makes pointer from integer without a cast. Why?

Sorry for tha numbers 27, 30, 36. I don't know how edit this post. My mistake

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>