title: How can I save a char into multiple variables ? C
body: <p>Ok so I need to input a string like this </p>
  
  <p><code>IP_1/MASK IP_2 NUM [NET_1 NET_2 NET3 ... NET_NUM]</code></p>
  
  <p>for example : </p>
  
  <p><code>192.168.25.87/24 192.168.26.1 3 192.168.0.0/16 192.0.26.0/16 192.168.26.0/24</code></p>
  
  <p>And then to split this string into multiple variables ( <code>IP_1</code>, <code>MASK</code> etc).
  I followed on internet a guide how to split it and I did it like this:</p>
  
  <pre><code>int main()
  {
      char* IP_1[256],IP_2[256],NET[256][256],character[256];
      int MASCA,NUM,i=1,j;
      char *p;
      gets(character);
      p=strtok(character,"/ ");
      while(p!=NULL)
      {
          printf("%s\n",p);
          p=strtok(NULL,"/ ");
      }
  </code></pre>
  
  <p>So, doing this I split the array into multiple elements, but how can I save these elements into <code>IP_1</code>, <code>MASK IP_2</code>, <code>NUM NET_1</code> etc ... ?</p>