tags:

views:

21

answers:

1

I have a problem getting a character from the user in VC++.the function i want to use uses the char format so when i get the input using getch() it gives me an error that can't convert 'int' to 'char'. could someone please help me how to get the input in char format please?

edit:

char key1[10]; 
key1=getch(); 
Main.draw_text(key1,120+(i*40),250,White,Black,20);
A: 

you would be better off editing your post instead of posting a code snippet in a comment.

Anyway, from the code it looks like you think getch() return a string, but it returns only one char, to get a string you need to use for instance

gets(key1);
Anders K.