title: Invalid conversion from void* to int*
body: <p>I have a global variable:</p>
  
  <pre><code>static int *avgg;
  </code></pre>
  
  <p>In main function:</p>
  
  <pre><code>avgg = mmap(NULL, sizeof *avgg, PROT_READ | PROT_WRITE, 
                  MAP_SHARED | MAP_ANONYMOUS, -1, 0);
  
  pid_t  pid, wpid;
  int status;
  
   pid = fork();
   if (pid == 0) {
        avg(argc,argv);
        print_avg();
  
    }
   else{ 
       while ((wpid = wait(&amp;status)) &gt; 0) {
  
       }
   cout&lt;&lt;"Parent process";
       print_avg();
  </code></pre>
  
  <p>By using mmap Im trying to share memory between parent and child process but Im getting error: </p>
  
  <pre><code>invalid conversion from ‘void*’ to ‘int*’ [-fpermissive]
                   MAP_SHARED | MAP_ANONYMOUS, -1, 0);
  </code></pre>