(It's a homework assignment, so for the sake of education you probably shouldn't hand me a straight answer...or at least not all of it )
Anyway, supposed to open a text file and change user-defined words to *BLEEP*, then writing it to a new file. Supposed to get the list of words to 'censor' from command-line arguments and store them in a string array.
my printf statement in the while loop never prints anything, so i'm guessing there's an error with the evaluation but i'm not sure what it is...can anyone enlighten me?
#define MAXLEN 1000
int main(int argc, char *argv)
FILE *in = fopen("bleepIn.txt","r");
FILE *out = fopen("bleepOut.txt","w");
if(in == NULL)
while(fgets (buffer,MAXLEN,in) != NULL)
if(strcmp(*argv,buffer) == 0)
address = strstr(*argv,buffer);
printf("%s",address); //never runs