From 7e051e3caa413c6bc11b3dde6728f30b4d04c264 Mon Sep 17 00:00:00 2001 From: tth Date: Mon, 30 Aug 2021 12:23:49 +0200 Subject: [PATCH] better messages --- code/ex_curses.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/ex_curses.c b/code/ex_curses.c index 38818ea..47b625a 100644 --- a/code/ex_curses.c +++ b/code/ex_curses.c @@ -5,8 +5,10 @@ int main(int argc, char *argv[]) { int key; -if (2 != argc) exit(1); - +if (2 != argc) { + fputs("need an argument\n", stderr); + exit(1); + } initscr(); /* first initialization */ cbreak(); /* no line buffering */ noecho(); /* be silent on input */ @@ -14,11 +16,9 @@ keypad(stdscr, TRUE); /* acces touches curseur */ mvaddstr(10, 3, argv[1]); refresh(); - key = getch(); - endwin(); -printf("code touche %d\n", key); +printf("code touche %d 0x%X\n", key, key); return 0; }