By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,337 Members | 2,084 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,337 IT Pros & Developers. It's quick & easy.

How to dynamically populate an array using kbhit() and getch()?

P: 1
my code (what I think I want):

for (lv=0;lv<20;lv++)

if (kbhit())//look for keypress
kp=getch();//assign keypress to variable "kp"
SD[lv]=(kp);//populate array with wanted digits

I'm trying to use the loop variable (lv) to populate that given array element i.e firs pass--SD[0] second pass SD[1]
etc., etc.
Thanks to all for any help
Oct 24 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.