on-internet
← Community

How to use write() or fwrite() for writing data to terminal (stdout)?

Stack Overflow ·

I am trying to speed up my C program to spit out data faster. Currently I am using printf() to give some data to the outside world. It is a continuous stream of data, therefore I am unable to use return(data). How can I use write() or fwrite() to give the data out to the console instead of file? Overall my setup consist of program written in C and its output goes to the python script, where the data is processed further. I form a pipe: ./program_in_c | script_in_python This gives additional benefit on Raspberry Pi by using more of processor's cores.

Comments

Sign in or sign up to comment and upvote.

No comments yet.