title: Invalid conversion from 'void*' to 'char*' when using mmap()
body: <p>I have the following snippet:</p>
  
  <pre><code>char* filename;
  unsigned long long int bytesToTransfer;
  int fd, pagesize;
  char *data;
  
  fd = open(filename, O_RDONLY);
  if (fd==NULL){
      fputs ("File error",stderr);
      exit (1);
  }
  
  cout &lt;&lt; "File Open: " &lt;&lt; filename &lt;&lt; endl;
  
  pagesize = getpagesize();
  data = mmap((caddr_t)0, bytesToTransfer, PROT_READ, MAP_SHARED, fd, 0);
  if (*data == -1) {
      fputs ("Memory error",stderr);
      exit (2);
  }
  
  cout &lt;&lt; "Data to Send: " &lt;&lt; data &lt;&lt; endl;
  </code></pre>
  
  <p>But when I compile, I receive:</p>
  
  <blockquote>
    <p>error: invalid conversion from ‘void*’ to ‘char*’ [-fpermissive]
      data = mmap((caddr_t)0, bytesToTransfer, PROT_READ, MAP_SHARED, fd, 0);</p>
  </blockquote>
  
  <p>Could someone give me a hint at what's wrong?</p>