title: My command window crashes after i input a name. C
body: <p>So that's my code, but every time I run it the command window crashes right after I input a name. I'm using Visual Basic, so it gives me a warning when I try to use:</p>
  
  <pre><code>scanf() 
  </code></pre>
  
  <p>so instead i decided to use:</p>
  
  <pre><code>scanf_s
  </code></pre>
  
  <p>I also tried to change the <code>%s</code> in <code>scanf_s("%s\n", name)</code> to <code>%c</code>. It stopped crashing and executed the program but when it prints the name, it would just be a bunch of broken text.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(void) {
     char name[30];
  
      printf("Enter your name:\n");
      scanf_s("%s\n", &amp;name);
      printf("%s\n", name);
  }
  </code></pre>