Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我有两个文件指针并执行以下操作:
FILE *f1,*f2; f1= fopen("inputfile","r+"); f2=f1; fclose(f2);
相等操作是否有效,如果有效,最后一行是否也会关闭 f1?
就足够了,两者都将被关闭,并且都将指向一个关闭的文件。
分配f2=f1不会做任何神奇的事情(增加引用计数或复制描述符)。
f2=f1