title: C++ Strings in Read Function from fcntl.h
body: <p>In my basic Linux Programming course at college, we use fcntl.h and unistd.h
  Using C++ strings, I get the following:</p>
  
  <pre><code>statusOfFunction = write(fileDescriptor, input.c_str(), input.length());
  </code></pre>
  
  <p>This line works. I get a file created, with the contents of input string. But, why doesn't any of these lines work:</p>
  
  <pre><code>statusOfFunction = read(fileDescriptor, reading.c_str(), 10);
  Error: No matching function call to "read"
  
  statusOfFunction = read(fileDescriptor, reading, 10);
  Error: No matching function call to "read"
  
  statusOfFunction = read(fileDescriptor, &amp;reading, 10);
  No error throws up, but does not get executed
  
  statusOfFunction = read(fileDescriptor, &amp;reading.c_str(), 10);
  Error: No matching function call to "read"
  </code></pre>
  
  <p><a href="https://www.dropbox.com/s/lnw208uo3xurqxf/Basic%20Unix%20Operations%20on%20Text%20Files.cpp?dl=0" rel="nofollow">https://www.dropbox.com/s/lnw208uo3xurqxf/Basic%20Unix%20Operations%20on%20Text%20Files.cpp?dl=0</a></p>
  
  <p>Here is the program, for your reference.
  Thank you! :)</p>