【发布时间】:2011-03-13 15:46:25
【问题描述】:
function()
{
FILE *ptr;
ptr = fileopen(file1.txt)
fprint(ptr, some text) //print to file 1
if(second file needed)
{
ptr = fileopen(file2.txt) //open a second file, assign to same file pointer
fprint(ptr, some text) //print to file 2 not working here?
}
}
编辑:
不打印到第二个文件...但是,fprint() 不返回负值。
【问题讨论】:
-
请在询问有关 C++ 的问题时使用 C++ 代码,而不是伪代码。
-
当然有人会问为什么您使用 C I/O 机制而不是更强大和方便的 C++ iostream。
-
不想改变原来的程序员设计...