title: strtok and int vs char in C
body: <p>I am learning how to delimate char arrays and I need to do an operation where I split a number and string into different variables and print them out. I believe I am close but when printing out what should be my number I get crazy numbers. Is this the address to the int? Any advice is greatly appreciated! My code and input/output:</p>
  
  <pre><code>    #include &lt;stdio.h&gt;
  
      int main() {
          setbuf(stdout, NULL);
          char name[10];
          printf("Enter in this format, integer:name\n");
          fgets(name, 10, stdin);                            //my input was 2:brandon
          char *n = strtok(name, ":");
          int num = (int)n;
          char * order = strtok(NULL, ":");
          printf("%d,%s", num,order);                        //my output was 7846332,brandon
          return (0);
      }
  </code></pre>