Reading which Character Key was pressed

Answer Posted / jagdish patel

#include<stdio.h>
#include<conio.h>
void main()
{
char character;

character=getch();

if(isalpha(character))
printf("alpha");

else if(isdigit(character))
printf("digit");
else
printf("pressed key is special key");
getch();
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to copy form data between different pages

1687


how to Scroll a DIV content

2167


code to positioning of window in certain dimensions

1676


snippet to prevent submission of form when certain/any validations got failed

1556


how to create a Draggable element

1976






create Drop-Down Navigation Menus

1710


How to block double clicks

1626


how to create an anonymous function

1740


Create a ViewState Property?

2297


determine which Element received an Event

1909


how to pass data between pages using Cookies

1860


communication between main window and new windows

1717


code to create a new window

1758


how to Auto Scroll the page

1637


code to images to rollover

1867