title: Substitution cipher giving me the same text in C program
body: <p>Over the last few weeks I've been meddling with encryption in C. I've been using a simple substitution cipher but I've encountered problems with the following code. Though the program runs smoothly, the contents of the text file "Message" always change to the same piece of text : <code>C=Øžû†</code>. I was hoping to change every character of the string in the file to a random letter.</p>
  
  <pre><code>#define _CRT_SECURE_NO_WARNINGS
  #include  &lt;stdio.h&gt;
  #include  &lt;stdlib.h&gt;
  #include  &lt;Windows.h&gt;
  #include  &lt;type.h&gt;
  #include &lt;string.h&gt;
  
  const int MAXSIZE = 50;
  
  void Encrypt(FILE *File, char file[MAXSIZE], int i, int j)
  {
      File = fopen("message.txt", "r+");
      for (i = 0; i &lt; 6; i++)
      {
          file[i] = rand() + 26;
          fputc(file[i], File);
      }
  
      printf("%s", file);
  
      fclose(File);
      return;
  }
  
  int main()
  {
      int i = 0;
      int j = 0;
      char file[MAXSIZE];
      FILE *File = 0;
  
      Encrypt(File, file, i, j);
  
      system("pause");
      return 0;
  }
  </code></pre>