经与EOF烦恼在Windows 7
目前,我正在学习用K&放C,R,我有一个很难通过CMD发送EOF模拟。我试图控制骨节病> + 以Z 骨节病>这什么也没做。
I'm currently learning C with K&R and I'm having a hard time sending EOF simulation through cmd. I was trying Ctrl + Z which did nothing.
在某些情况下,输入骨节病>正在做的工作,并在其他情况下没有什么做的。
In some cases Enter is doing the work and in other cases nothing does it.
感谢您事先的任何帮助。
Thanks in advance for any help.
假设你使用的是Windows的情况是,你基本上做到 CTRL 骨节病> + 以Z 骨节病>在一行的开头 - 也就是说,你必须击中输入骨节病>,然后执行 CTRL 骨节病> + 以Z 骨节病>,然后(视如何输入被读取)可能输入骨节病>试。
Assuming you're on Windows, the situation is that you basically have to do the ctrl+Z at the beginning of a line -- i.e., you have to have hit enter, then do the ctrl+Z, then (depending on how the input is being read) possibly enter again.
您也可以使用 F6 骨节病>信号输入的结束。至少在大多数情况下,这将工作,即使/如果它的不的紧跟一个输入骨节病>。
You can also use F6 to signal the end of the input. At least in most cases, this will work even when/if it does not immediately follow an enter.
不幸的是,Windows提供了足够的不同的方法和模式,以读取输入,这一点很难说出一大堆绝对肯定,除非我们知道你正在使用(或者更具体地说,标准库),以及编译器为确切code你写。一般情况下,只需按输入骨节病>应的不的被检测为文件结束,但你的code可以治疗一个空行作为输入的结束。
Unfortunately, Windows provides enough different ways and modes to read input, that it's a little hard to state a whole lot with absolute certainty unless we know the compiler you're using (or, more specifically, the standard library) as well as the exact code you've written. Under normal circumstances, just hitting enter should not be detected as end of file, but your code could be treating an empty line as the end of input.