title: Lowercase to Uppercase and Uppercase to Lowercase in C
body: <p>Does anyone would help me with this code ? The function needs to do like in topic is written. Is it ok ? What is more I need is to count the number of made changes. How to implement this one ?</p>
  
  <pre><code>int change(char *path){
  
  FILE *f = fopen(path, "r");
  if(f==NULL){
      printf("Error...");
      return -1;
  }
  int text, length;
  
      fscanf(f, "%s", &amp;text);
      length = strlen(text);
  
   for(i = 0; i &lt; length; ++i){
      if(islower(text[i]))
            {
            text[i] = toupper(text[i]);
            }
      if(isupper(text[i]))
      {
          text[i] = toslower(text[i]);
      }
  fprintf(f,"%s",text);
  fclose(f);
  </code></pre>