system(do_this); // which executes an external program to output a phrase on the screen
printf("=My taxes");
Output:
500$
=My taxes
Expected output:
500$=My taxes
I don’t have control over the code executing in do_this which automatically outputs the '\n'.
This should work:
where program is the program you want to run. The
trcommand removes all CR and LF characters (codes 015 and 012 octal) from program‘s output. The solution assumes program only outputs one line (your tax) and it works on systems with line endings CR, LF, CR+LF, LF+CR (includes all widely used operating systems like MacOS, Linux and Windows).