title: How to get numbers from this type of string in C
body: <pre><code>1 13 3 4; 5 6 7 8; 9 10 11 12; 2 15 14 0
  </code></pre>
  
  <p>How can I get numbers from this string in ANSI C?</p>
  
  <p>I tried to separate it with strtok() :  </p>
  
  <pre><code>char *vstup = argv[1];
  char delims[] = ";";
  char *result = NULL;
  result = strtok( vstup, delims );  
  
  while( result != NULL ) {
      printf( "result is \"%s\"\n", result );
      result = strtok( NULL, delims );
  } 
  </code></pre>
  
  <p>and I got this:  </p>
  
  <pre><code>result is "1 13 3 4"  
  result is " 5 6 7 8"  
  result is " 9 10 11 12"  
  result is " 2 15 14 0"  
  </code></pre>
  
  <p>Now I don't know how to get numbers in integers and save them to two-dimensional field (matrix). I need something like this:  </p>
  
  <pre><code>field[1][1] = 1
  .
  .
  .
  etc. 
  </code></pre>
  
  <p>I'm wondering about atoi(), but I'm not sure, if it would recognize for example "13" as one number..  </p>