So my code pretty much works the way i want it to. There is just some strange behavior that I was hoping you guys could shed some light on.
It's supposed to count until the user passes it a 0 and then output how high it was able to count in that span of time. If the user passes it anything else other than a zero it should ignore that input. If I run it, wait a bit, then pass it a zero, it works perfectly. If I run it and pass it as many 1's as i like, it ignores all of those inputs until i pass it a 0 and then again, it works perfectly. But here's the rub, if i pass it anything > than 1 it stops responding. Anything greater than 1 should evaluate the exact same way as a 1. so i just don't understand. Here is code, thanks in advance to everyone who takes a look.
because i don't know any other way to use a thread yet. if you could show me the analogue to this program that does that same thing with out using a function i would be very grateful. i just based this on some example code that I've seen and that code used functions.