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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -