请问如何c语言中如何将print信息写入一个文件
请问如何c语言中如何将print信息写入一个文件
[解决办法]
打开一个文件,用fprintf写入,就像写到stderr一样就行了
[解决办法]
人家说的是把打印到屏幕上的内容写入文件中。
在控制台中输入***.exe > ***.txt就行了,不过如果你是想直接在程序内部实现只能把想打印的字符串或者得到的变量的值用fwrite或者fprintf等函数直接写入文件。
[解决办法]
google "Redirected Input and Output ";
or see this post:
http://www.codeproject.com/threads/redir.asp