title: Passing variables to system function in C
body: <p>I have this C code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()
  {
      int a;
  
      printf("Please enter a number:\n");
      scanf("%d",&amp;a);
      printf("Your number is: %d\n",a);
      system("echo %d",a);
  }
  </code></pre>
  
  <p>I'm interested in the last command, the <code>system()</code> function and why I can't print my variable like i printed it with <code>printf()</code>. I want to be able to ask the user some input , let's say a string and then pass it to the system function. </p>
  
  <p><strong>Practical example:</strong></p>
  
  <p>Ask user for folder name</p>
  
  <pre><code>system("mkdir %s", FolderName);
  </code></pre>
  
  <p>Thank you in advance! :)</p>