Lets say we have this code
Code:
char string [256];
printf("please write something here:\n");
gets(string);
printf("You typed:%s\n",string);
Is there any way to do it ?
Thanks in advance.
|
Light Poster
|
|
| 30Mar2012,19:35 | #1 |
|
Hello.
Lets say we have this code Code:
char string [256];
printf("please write something here:\n");
gets(string);
printf("You typed:%s\n",string);
Is there any way to do it ? Thanks in advance. |
|
Light Poster
|
|
| 30Mar2012,20:14 | #2 |
|
Sorry "VK_PRIOR " is the virtual key code of the page Up button.
|
|
Mentor
|
![]() |
| 31Mar2012,21:01 | #3 |
|
You need to use a function that returns VK_ values, such as GetKeyState. gets is not one of those functions so you cannot use it for what you want to do.
|
|
John Hoder
|
|
| 1Apr2012,02:30 | #4 |
|
Quote:
Originally Posted by xpi0t0s Code:
if(GetKeyState(VK_PRIOR))
{printf("you pressed %s", string);}
else if (GetKeyState(VK_F5))
{etc.....}
|