title: error: used struct type value where scalar is required
body: <p>I am creating a program which takes an input and opens a text file and changes words to lower or upper case depending on what the user wants. When I compile the program I gets the following error:</p>
  
  <pre><code>22:11: error: used struct type value where scalar is required
  30:11: error: used struct type value where scalar is required
  
    1 #include &lt;stdio.h&gt;
    2 int main(void) {
    3
    4         char choice;
    5         char fileName;
    6         char newFileName;
    7         int i = 0;
    8
    9         printf("Change Case \n");
   10         printf("============\n");
   11         printf("Case (U for upper, L for lower) : ");
   12         scanf(" %c", &amp;choice);
   13         printf("Name of the original file : oldFile.txt \n");
   14         printf("Name of the updated file : newFile.txt \n");
   15
   16         FILE *fp = NULL;
   17
   18         fp = fopen("oldFile.txt", "a");
   19
   20         if (fp != NULL &amp;&amp; choice == 'L') {
   21
   22                 while ( fp[i] ) {
   23
   24                         putchar(tolower(fp[i]));
   25                         i++;
   26                 }
   27         }
   28         else if (fp != NULL &amp;&amp; choice == 'U') {
   29
   30                 while ( fp[i] ) {
   31
   32                         putchar(toupper(fp[i]));
   33                         i++;
   34                 }
   35         }
   36         else {
   37
   38                 printf("ERROR: No proper choice was made \n");
   39         }
   40 }
  </code></pre>