View Single Post
Old 01-09-2009, 04:24 PM   #6 (permalink)
jaeusm
 
Software Developer

Join Date: Mar 2006

Location: Columbus, OH

Posts: 569

jaeusm is on a distinguished road

Default Re: C#, kbhit & getch

That code won't run. Actually, it won't compile because the negation operator cannot be applied to any type other than an object of type Boolean. In your case, you're applying it to an integer.

Anyhow, it's a bit overkill to use p-invoke when the Console class provides all the methods (ReadKey() in this case) that do the exact same thing.

Last edited by jaeusm; 01-09-2009 at 04:27 PM.
jaeusm is offline