title: atoi from string to Integer using char pointer
body: <p>Here is the code I have written which splits a string in c and then I want to return the first integer value pointed by the char pointer.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  void main(){
      int month[12]={0};
      char buf[]="1853 was the year";
          char *ptr;
          ptr = strtok(buf," ");
          printf("%s\n",ptr);
          int value = atoi(*ptr);
          printf("%s",value);
  } 
  </code></pre>
  
  <p>EDIT:It gives me segmentation fault.</p>
  
  <p>The problem is it is printing 1853 as the year, But I want to convert this into integer format.How can i retrieve that value as an integer using the pointer?</p>