c - Prevent line being printed to command line pipe to file -
the title maybe little confusing.. here attempt of explaining it:
i have command program:
c file1.txt > file2.txt
this command in commandline takes first file , pipes output of program (that printed) second file.
so im scanning user message in:
printf("enter message:"); char *message = malloc(sizeof(char) * 256); scanf("%s", message); printf("your message is: %s", message);
but prints both printf(...)
statements piped file, whereas want second one. how can prevent this?
thanks!
one way use stderr
information don't want copied output file:
fprintf(stderr, "enter message:");
Comments
Post a Comment