を使用していくつかの文字列を印刷しようとしていますprintf()
が、それらはヌル終了末尾に改行があり、それがフォーマットを台無しにします:
printf("The string \"%s\" was written onto the file \"%s\"", str, fname);
文字列に含まれ"The Racing car."
、ファイル名が次のように表示されるとします"RandomText1.txt"
。
The string "The Racing car.
" was written onto the file "RandomText1.txt
"
ただし、1行だけで印刷したい:
The string "The Racing car." was written onto the file "RandomText1.txt"
文字列を変更して、ヌル ターミネータ改行ですが、可能であれば、文字列を変更せずにこの出力を実現する方法が欲しいです。
出来ますか?