I'm trying a very simple programm where whatever is written in test.txt gets copied in up.txt but in capital letters. I'm using dev c++ on windows 11 and after running the programm the up.txt file is created but it is empty and i can't figure out why.
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int main(){
FILE *fpin, *fpout;
char x;
fpin=fopen("test.txt","r");
if(fpin==NULL){
fprintf(stderr,"read error\n");
exit(666);
}
fpout=fopen("up.txt","w");
if(fpout=NULL){
fprintf(stderr,"write error/n");
exit(667);
}
while((x=fgetc(fpin))!=EOF){
fputc(toupper(x),fpout);
}
fclose(fpin);
fclose(fpout);
return 0;
}
I tried the same programm on linux succesfully but i'm not sure why it doesn't work on windows