title: fscanf() how to go in the next line?
body: <p>So I have a wall of text in a file and I need to recognize some words that are between the $ sign and call them as numbers then print the modified text in another file along with what the numbers correspond to.
  Also lines are not defined and columns should be max 80 characters.</p>
  
  <p>Ex: </p>
  
  <pre><code>I $like$ cats.  
  I [1] cats.  
  [1] --&gt; like
  </code></pre>
  
  <p>That's what I did:</p>
  
  <pre><code>    #include &lt;stdio.h&gt;
      #include &lt;stdlib.h&gt;
  
      #define N 80
      #define MAX 9999
      int main()
      {
          FILE *fp;
          int i=0,count=0;
          char matr[MAX][N];
  
          if((fp = fopen("text.txt","r")) == NULL){
              printf("Error.");
              exit(EXIT_FAILURE);
          }
  
          while((fscanf(fp,"%s",matr[i])) != EOF){
              printf("%s ",matr[i]);
              if(matr[i] == '\0')
                  printf("\n");
  
              //I was thinking maybe to find two $ but Idk how to replace the entire word     
              /*                                 
              if(matr[i] == '$')
                  count++;
              if(count == 2){
                  ...code...
              }
              */
              i++;
          }
  
  
  
          fclose(fp);
          return 0;
     }
  </code></pre>
  
  <p>My problem is that fscanf doesn't recognize <code>'\0'</code> so it doesn't go in the next line when I print the array..also I don't know how to replace <code>$word$</code> with a number.</p>