title: C++ At() function of class string Access violetion
body: <p>this code throw me an Access violation error </p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace std;
  
  int _tmain(int argc, _TCHAR* argv[])
  {
      string a;
      cin &gt;&gt; a;
      printf("%s",a.at(1));
      return 0;
  }
  </code></pre>
  
  <p>I wrote this line because this function gave me problem with a larger program and i want to figure out what the problem really is...
  thanks !</p>