title: In C, how can I convert a string to a character array?
body: <p>I have the passed argument <code>argv[1]</code> in my C program, and I want to convert that string into a character array. How may I do this?</p>
  
  <pre><code>int main(int argc, char* argv[])
  {
      char c [] = argv[1]; // This is what I want to do...
  }
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>What I'm trying to do is get certain characters from <code>argv[1]</code> and check if they are numbers. So, ideally, I would do something like:</p>
  
  <pre><code>int a = argv[1][2] 
  </code></pre>
  
  <p>But this just runs into another problem - how can I check the type of a variable in C?</p>