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

maximizing the main window

1813


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

1709


communication between main window and new windows

1883


how to create Expandable and Collapsible Menus

2839


Create a ViewState Property?

2440






function to combine two or more arrays

1863


sample code to auto focusing the first field in a form

2186


how to copy form data between different pages

1930


how to create an anonymous function

1873


code to positioning of window in certain dimensions

1848


I have a doubt regarding including tags in a function. I have written a function in javascript in a html page. The function got called by clicking a button, i want to display the results in same html page by placing tags in the function. (this hmtl page is static page) Is this possible? example: