C++: cin.getline - no instance of overload function
<p>I'am trying to write a line of text to a .txt file, but visual studio 2015 is giving me the following error.</p>

<blockquote>
  <p>Severity   Code    Description Project File    Line    Suppression State
  Error (active)      no instance of overloaded function "std::basic_istream&lt;_Elem, _Traits>::getline [with _Elem=char, _Traits=std::char_traits]" matches the argument list    Studying    c:\Users\Klaas\Documents\Visual Studio 2015\Projects\Studying\Studying\Studying.cpp 16</p>
</blockquote>

<p>and</p>

<blockquote>
  <p>Severity   Code    Description Project File    Line    Suppression State
  Error   C2664   'std::basic_istream> &amp;std::basic_istream>::getline(_Elem *,std::streamsize,_Elem)': cannot convert argument 1 from 'std::string' to 'char *'    Studying1   c:\users\klaas\documents\visual studio 2015\projects\studying1\studying1\studying1.cpp  16  </p>
</blockquote>

<p>My source code: </p>

<pre><code>#include &lt;iostream&gt;
#include "stdafx.h"
#include &lt;fstream&gt;
#include &lt;string&gt;

using namespace std;
int main()
{
    ofstream myFile;
    string myText;
    myFile.open("sometext.txt");
    cout &lt;&lt; "Write text to save to file: ";
    cin.ignore();
    cin.getline(myText, sizeof(myText));
    myFile &lt;&lt; myText;
    myFile.close();
    return 0;
}
</code></pre>

<p>I have done multiple searches and found answers such as including </p>

<pre><code>cin.ignore();
</code></pre>

<p>above the</p>

<pre><code>cin.getline
</code></pre>

<p>, but i just can't get it to work and i don't really understand what the error means, and i don't see why it thinks i'm trying to convert a string to char.</p>

<p>Any tips would be very welcome :)</p>