• (Hint, ASCII code for ESC is 27, for ‘A’ is 65, and
for ‘a’ is 97. the values are given in decimal
notation)
C doesn't have a "getch() command".
Are you incapable of doing anything for your self?
--
Ian Collins
#include <stdio.h>
#include <ctype.h>
#include <curses.h>
#define KEY_ESC 27
int main(void)
{
int c, rv = 0;
if(initscr() && cbreak() == OK && noecho() == OK) {
printw("(escape to exit)\n");
refresh();
while((c = getch()) != KEY_ESC) {
printw("%c", toupper(c));
refresh();
}
if(endwin() == ERR)
rv = 1;
} else
rv = 1;
return rv;
}
And, it doesn't take much skill to figure this out for yourself. You already
have most of the solution in your original post.
--
--------------------------------------------------------------
Professional mobile software development
BreezySoft Limited www.breezysoft.com
--------------------------------------------------------------