0
int main(void)
{
    {
        char original;
        FILE* fptr;
        FILE* fptr2;
        fptr = fopen("hello.txt", "r"); // reads this file
        fptr2 = fopen("hello_uppercase.txt", "w"); // able to modify file

        while((original = getc(fptr)) != EOF) // end of file
        {
            char uppercaseOrigin = toupper(original);
            // uses the upper function from ctype library to capitalize all alpha characters
            fputc(uppercaseOrigin, fptr2);
            // inserts the final result in fptr2 which is a file destination
        }

        fclose(fptr); // closes file
        fclose(fptr2); // closes file
        return 0;
    }
}

getc and fputc are producing warnings as int can not be passed to char, unable to find solution. Code did work on VS code but not in Clion. What this code does is to open a file and convert all alpha characters to uppercase. After it would be put into another file both in the code. Any suggestions about how to fix the conversion issue, thank you.

0 Answers0