title: No matching function for call to 'std::basic_ofstream<char>::write(std::string*, long long unsigned int)'
body: <p>So I was playing around a bit with file ofstream and ifstream and got stuck into a compiler problem that I just simply don't know what it means...</p>
  
  <p>Let's start.</p>
  
  <p>I have the following class:</p>
  
  <pre><code>class FS{
      public:
          string name;
          long long int size;
          long long int freeBlocks;
          long long int usedBlocks = 0;
          int blocksize = 128;
          vector&lt;FS_File&gt; file_list;
          char * ptr;                      //This is a malloc pointer
          void saveTo(ofstream&amp; of); 
          void openFrom(ifstream&amp; inf); 
      };
  </code></pre>
  
  <p>The problem occurs in the <strong><em>saveTo()</em></strong> function:</p>
  
  <pre><code>void FS::saveTo(ofstream&amp; of){ 
    of.write(&amp;name, sizeof(name)); 
    of.write(&amp;size, sizeof(size));
    of.write(&amp;freeBlocks, sizeof(freeBlocks)); 
    of.write(&amp;usedBlocks, sizeof(usedBlocks)); 
    of.write(&amp;blocksize, sizeof(blocksize)); 
    of.write(&amp;file_list, sizeof(file_list));
    of.write((char *)&amp;ptr, sizeof(ptr));
  }
  </code></pre>
  
  <p>The compiler gives me the next error:</p>
  
  <pre><code>functions.cpp   In member function 'void FS::saveTo(std::ofstream&amp;)':
  
  
      [Error] no matching function for call to 'std::basic_ofstream&lt;char&gt;::write(std::string*, long long unsigned int)'
  
      [Error] no matching function for call to 'std::basic_ofstream&lt;char&gt;::write(long long int*, long long unsigned int)'
  
      [Error] no matching function for call to 'std::basic_ofstream&lt;char&gt;::write(long long int*, long long unsigned int)'
  
      [Error] no matching function for call to 'std::basic_ofstream&lt;char&gt;::write(long long int*, long long unsigned int)'
  
      [Error] no matching function for call to 'std::basic_ofstream&lt;char&gt;::write(int*, long long unsigned int)'
  
      [Error] no matching function for call to 'std::basic_ofstream&lt;char&gt;::write(std::vector&lt;FS_File&gt;*, long long unsigned int)'
  
      [Error] no matching function for call to 'std::basic_ifstream&lt;char&gt;::read(std::string*, long long unsigned int)'
  
      [Error] no matching function for call to 'std::basic_ifstream&lt;char&gt;::read(long long int*, long long unsigned int)'
  
      [Error] no matching function for call to 'std::basic_ifstream&lt;char&gt;::read(long long int*, long long unsigned int)'
  
      [Error] no matching function for call to 'std::basic_ifstream&lt;char&gt;::read(long long int*, long long unsigned int)'
  
      [Error] no matching function for call to 'std::basic_ifstream&lt;char&gt;::read(int*, long long unsigned int)'
  
      [Error] no matching function for call to 'std::basic_ifstream&lt;char&gt;::read(std::vector&lt;FS_File&gt;*, long long unsigned int)'
  </code></pre>
  
  <p>Whenever I try to call the next code:</p>
  
  <pre><code>ofstream outfile;
  string filename = curFS.name + ".dat";
  outfile.open(filename, ios::binary | ios::out);
  curFS.save(outfile);
  outfile.close();
  </code></pre>
  
  <p>I've tried a few things, but nothing has worked...</p>
  
  <p><strong><em>What does the compiler error means?
  How can I solve it?</em></strong></p>