This code will hang at count = 10 until something is read from the command prompt. How do I avoid this block?
That isn't what happens running your code on my system. I waited until the count reached 14 the typed 'x' 3 times and ^C once:
c:\test>junk85
test, count:0
test, count:1
test, count:2
test, count:3
test, count:4
test, count:5
test, count:6
test, count:7
test, count:8
test, count:9
test, count:10
test, count:11
@test, count:12
@test, count:13
test, count:14
x->120
@test, count:15
x->120
test, count:16
x->120
@test, count:17
Terminating on signal SIGINT(2)
Hard to advise on how to avoid something that doesn't happen?
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|