title: convert a text from a file
body: <p>I'm doing a project where I need to convert a text from a file to morse. For this I stored the alphabet and its respective code morse (which is also in a file) into a struct..</p>
  
  <p>The file "original.txt" is something like:</p>
  
  <pre><code>My name is Olivia
  We are in 2019
  3 plus 4 is 7
  </code></pre>
  
  <p>the file "morse.txt" is:</p>
  
  <pre><code>
      A .-*  
  
      B -...* 
  
      C -.-.*
  
      D -..*
  
      E .* //the file has the 26 letters and the 10 digits
  
  </code></pre>
  
  <p>etc..</p>
  
  <p>now the only problem I have is: </p>
  
  <pre><code>warning: comparison between pointer and integer 
  &gt; if (line[i] == l[j].letters){ (line 25)`
  </code></pre>
  
  <pre><code>    #include &lt;stdio.h&gt;
      #include &lt;stdlib.h&gt;
      #include &lt;string.h&gt;
      #include &lt;ctype.h&gt;
  
      /* Constants */
      #define T_MORSE 8
      #define Q_LETTERS 26
      #define Q_NUMBERS 10
      #define Q_MORSE (Q_LETTERS+Q_NUMBERS)
      #define MAX_STRING_SIZE 50
  
  
  
      typedef struct{          /* needs a position to the string finisher \0               */
          char letters[5];     /* stores the letters , get it as a string , but use only the first letter */
          char lettersMorse[T_MORSE];/* stores the respective morse symbols of the letters                 */
      }alphabet;
      alphabet l[Q_MORSE];
  
      void process(const char *line) {
          int j, i;
          for (i = 0; line[i]; ++i) {
              for ( j = 0; j &lt; 37; ++j ){      //vector for morse letters
               if (line[i] == l[j].letters){
                printf("%s", l[j].lettersMorse);
                printf("   ");}
              }
          }
      }
  
      int main(){
          int cont=0,j;
          FILE *arch;
          arch = fopen("morse.txt","r");
          if( arch == NULL ){
              printf("ERROR");
              return 0;
          }
          else{
              while(fscanf(arch,"%s%s",l[cont].letters,l[cont].lettersMorse) != EOF){
                  l[cont].letters[1] = '\0';                            /* eliminates unwanted characters           */
                  for(j=0; j&lt;strlen(l[cont].lettersMorse); j++){
                      if(l[cont].lettersMorse[j] == '*'){               /* if an asterisk is found                */
                         l[cont].lettersMorse[j] = '\0';                /* eliminate asterisk                   */
                         break;
                      }
                  }
  
                  cont++;                                             /*points to the next position of the vector     */
              }
          }
          fclose(arch);
  
          FILE *fp;
          char line[MAX_STRING_SIZE];
          fp = fopen("original.txt", "r");
          if (arch==NULL){
          printf("ERROR");}
          while (fgets(line,MAX_STRING_SIZE,fp) != NULL) {
          process(line);
          }
          fclose(fp);
  
          return 0;
      }
  
  '''
  </code></pre>