C program swap case ( debug)

There are errors in this program

I/Welcome to the metaverse!

#include <stdio.h>

#include <stdlib.h>

#include <string.h> #include <unistd.h>

#define FILE LENGTH 100000 void readFile(FILE *fp. char filename[], char *textArray); void write File(FILE "fp, char filename[], char *textArray):

int main()

FILE *fp1:

FILE *fp2,

char textArray = (char)malloc(FILE_LENGTH sizeof(char)).

printf("Reading File - sample txt\n");

sleep(3);

readFile(fp1. "sample.txt", textArray); printf("File read successfully\n");

sleep(1);

printf("Manipulating the content\n").

sleep(3);

swapCase(textArray);

printf("Content manipulated successfully\n");

sleep(1):

printf("Writing manipulated content into debugOutput.txt\n").

sleep(3); writeFile(fp2, "debugOutput txt", textArray);

printf("Writing into file completed\n");

free (textArray);

return 0;

}

void readFile (FILE "fp, char filename[], char *textArray)

{

char c[1000];

fp = fopen(filename, "r"):

while (fget(c, sizeof(c), fp)) strcat(c, textArray);

fclose(fp);

return;

}

void writeFile(FILE *fp, char filename[], char *textArray)

{

fp = fopen(filename, "r");

if (strlen(textArray) >= 0) fput(textArray, fp):

fclose(fp):

return;

}

void swapCase(char "text)

int ch:

for (int c = 1; c < strlen(text). c++)

ch = text[c]:

if (ch >= 'A' & ch <= 'Z') text[c] = text[c] + 1;

else if (ch >= 'a' & ch <= 'z') text[c] = text[c] - 1:

}

return;

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum