paI*_*ase 0 c loops scanf while-loop eof
我有一些代码执行一段时间(fscanf!= EOF)循环.但是,即使fscanf执行完毕,我仍需要继续运行该代码,直到满足某些条件.我的意思是我想我可以将代码复制/粘贴到while(fscanf)循环之外,并且只使用全局变量,但这看起来很混乱.当然有人之前遇到过这样的事情并且有一个更清洁的解决方案.
难道你不能修改while
条件来解释这些附加条件吗?
while(fscanf(...) != EOF || !(some_other_conditions_met))
Run Code Online (Sandbox Code Playgroud)