title: How can I read a string with scanf() in C++?
body: <p>I can read a string with <code>std::cin</code> but I don't know how to read with one withscanf(). How can I change the code below to use scanf() ? </p>
  
  <pre><code>string s[20][5];
  
  for (int i=1;i&lt;=10;i++)
  {
    for (int j=1;j&lt;=3;j++) 
    {
        cin&gt;&gt;s[i][j];
    }
  }
  </code></pre>