title: How do I use scanf to name a file?
body: <p>I'm trying to make a sort of note pad for the command prompt with C++. I want someone to be able to put in the name they want for the file and what they want in the file. How would I do that? This is what I have:</p>
  
  <pre><code>printf("What do you want to call it?\n");
      scanf_s("%s", &amp;filename);
  
      ofstream myfile;
      myfile.open("%s", filename);
      myfile.close();
      return 0;
  </code></pre>
  
  <p>If you want, you can edit this or just make it from scratch.
  Also, please help me let them type what they want in it.</p>