title: Read file and tokenize by strtok in c
body: <p>In this program, I want to read a file and convert that into string and tokenize them with whitespace, \n, comma, and + but I am getting infinite execution of the first line</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;stdlib.h&gt;
  int main()
  {
  FILE *fp;
  char ch,buff[500],bb[500];
  int i=0;
  fp=fopen("i.c","r");
  if(fp==NULL) printf("File not opened");
  else{
      printf("File opened successfully\n");
      ch=getc(fp);
      while(ch!=EOF){
          fgets(buff,500,fp);
         strcat(bb,buff);
      ch=getc(fp);
   }
  char *tok=strtok(bb,"\n ,+=");
  while(tok!=NULL){
  printf("%s",tok);
  tok=strtok(bb,"\n ,+=");
  }
  }
  }
  </code></pre>
  
  <p>This is my file which I am reading i.c</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;stdlib.h&gt;
  int main()
  {
  int num1=5,num2=6,num3;
  char str[10]="hello";
  num3=num1+num2;
  printf("%s:%d",str,num3);
  }
  </code></pre>