Hi,
I have to write a program that replaces all vowels in a given file with *. Here's my code:
But the program doesn't do anything. Anyone know why it doesn't do anything?Code:#include <stdio.h> #include <string.h> int main(){ FILE *fp = fopen("data.txt", "r+");; char c; while ((c = getc(fp)) != EOF){ if (c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U' || c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u'){ fp--; putc('*', fp); } } return 0; }