title: reading a text file into an array
body: <p>I'm really new to programming, and after thinking hard about this for a week for a summer project, I'd really appreciate some help!</p>
  
  <p>I'm trying to read in a long text file, which is just a long string (NB: not an actual programming string) of letters, and then put each letter into its place in the grid (the aim of the program is ultimately to solve a wordsearch) so far I've come up with the program below, which doesn't seem to be producing a grid, but rather just reprints the text file, preceded by the following: </p>
  
  <pre><code>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf510    
  {\fonttbl\f0\fmodern\fcharset0 Courier;}
  {\colortbl;\red255\green255\blue255;}
  \paperw11905\paperh16837\margl1440\margr1440\vieww10800\viewh8400\viewkind0
  \deftab720
  \pard\pardeftab720
  
  \f0\fs24 \cf0 
  </code></pre>
  
  <p>The program that I've written is this:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdio.h&gt; 
  #include &lt;stdlib.h&gt; 
  #include &lt;math.h&gt;
  #include &lt;stdbool.h&gt;
  
  int main()
  {
      int i,j;
      char myarray[26][26],x;
      FILE *myfile;
  
      for (j=0; j&lt;26; j++)                 //initialise array elements all to zero
      {
          for (i=0; i&lt;26; i++)
          {
              myarray[i][j]=0;
          }
      }
  
      myfile=fopen("*redacted*","r");
      if (myfile!=NULL) //check file actually opened
      {
          for (i=0; i&lt;26; i++)
          {
              for(j=0; j&lt;26; j++)
              {
                  fscanf(myfile,"%c",&amp;x); //read the values in
                  myarray[i][j]=x;
              }
          }
          // data is now in the array called myarray
          fclose(myfile);        
      }
  
      else
      {
          printf("File not found");
      }
  
      for(i=0;i&lt;26;i++)
      {
          for(j=0;j&lt;26;j++)
          {
              printf("%c",myarray[i][j]);
          }
      }
  
  }
  </code></pre>
  
  <p>Thank you for any help you can offer</p>