Q:

missing some basic, issues casting strtok returns to other data types

Forgive the basic question, but i'm missing something foundational. Recently found myself having to code after 8 years of complete programming inactivity. 
What i'm trying to do is read in a string (known amount of tokens within it), and then take these characters and convert them to integers. 
This second part is my problem. I'm sure it's the way i'm handling the pointers,but am unsure exactly where i'm going wrong. 
Any tips would be welcome, i'm sure there are several issues below. 
#include <stdio.h>
#include <string.h>

int main ()
{
  char str[] ="20\n3000 53\n96";
  char * pch;

  int num_one = 0;
  int num_two = 0;
  int num_three = 0;
  int num_four = 0;

  printf ("Splitting string \"%s\" into tokens:\n",str);
  printf("\n");
  pch = strtok (str," \n");
  num_one = atoi(&pch);
  printf ("%s\n",pch);  
  printf ("%u\n",num_one);   

  pch = strtok (NULL, " \n");
  printf ("%s\n",pch);  
  num_two = atoi(&pch);
  printf ("%u\n",num_two);  

  pch = strtok (NULL, " \n");
  num_three = atoi(&pch);
  printf ("%s\n",pch);  
  printf ("%u\n",num_three);  

  pch = strtok (NULL, " \n");
  num_four = atoi(&pch);
  printf ("%s\n",pch);  
  printf ("%u\n",num_four);      
  return 0;
}

Current output(can't get it to format correctly, but the \n are behaving as they should):
Splitting string "20 
3000 53
 96" into tokens:
20
0
3000
0
53
0
96
0

A:

Firstly note that your string constants are const - you cannot modify them. strtok() will modify the calling string, so this can give rise to a GPF or core dump, unless you copy them.
I see you are calling atoi(&pch) which is incorrect - that should be atoi(pch); You gave it a pointer to a pointer to the string, and not a pointer to the string.

