title: c++ use a buffer in memory instead reading directly a file
body: <p>I have this code that works fine: </p>
  
  <pre><code>FILE *fp;
  fp = fopen(filename.c_str(), "rb");
  char id[5];
  fread(id,sizeof(char),4,fp);
  </code></pre>
  
  <p>now I've changed something in my architecture, and instead the filename as fullpath of the file I have a char pointer that contains the data of the file.. so I don't need to read (fopen, etc..) but only to read the char* buffer...
  how can I do this?
  thanks in advance</p>