Hi,
I read online and figured that the way to reroute the printf() output is by overriding the fputc() function.
int fputc(int character, FILE *f)
but where should i point *f?
Thanks
Aaditya
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
The MSP430 example code in Overriding the fputc() and fputs() functions shows that the FILE *f argument is not used in the overridden functions. I think that means if you are only dealing with one output device the fputc can ignore the file argument, which will be set to stdout when called from printf.Aaditya Kandibanda said:but where should i point *f?
An alternative is to install a user-defined driver which can be attached to specific streams - see Using printf() to output to a user-defined device.Aaditya Kandibanda said:I read online and figured that the way to reroute the printf() output is by overriding the fputc() function.