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 create a Draggable element

1976


code to detect versions of different browsers like internet explorer, netscape, mozilla, opera etc

1749


how to create a Custom Scrollbar

2060


code to sorting an array of objects

1999






code to images to rollover

1874


how to pass data between pages using Frames

2157


how to convert between arrays and strings

2121


how to get the User's Time of Day

1683


communication between main window and new windows

1719


Create a Menu that can be activated while clicking on Right Mouse button

1717


how to Scroll a DIV content

2171


maximizing the main window

1645


function to combine two or more arrays

1711


code to keep a page Out of the browser history

1669