#include <string.h>
#include <stdio.h>
#include <stdlib.h>

/* http://www.tutorialspoint.com/c_standard_library/c_function_atoi.htm
   http://www.tutorialspoint.com/c_standard_library/c_function_strtok.htm
*/

int main()
{
   char str[80] = "No. of patterns : 500";
   char s[2] = ":";
   char *token;
   int  val;
   
   /* get the first token */
   token = strtok(str, s);
   
   /* walk through other tokens */
   while( token != NULL ) 
   {
      printf( " %s\n", token );
    
	  /* This will fail for first string "No. of patterns" */
	  val = atoi(token);

	  printf( " %d\n", val );

      token = strtok(NULL, s); 
   }
   
   return(0);
}