MIPI_BaseC_WebinarFRTK/06_Lecture06/03_getch_p13_ncurses.c
2024-11-13 09:22:28 +03:00

22 lines
736 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <stdio.h>
//#include <conio.h>
#include <ncurses/ncurses.h>
int main ()
{
char character;
initscr();
noecho();
//~ puts("Exit('.'):");
printw("Exit('.'):\n");
do
{
character = getch(); // считать введённый со стандартного потока ввода символ
if(character>='a' && character<='z') //все символы лежат подряд a=97, b=98, c=99, ...
addch('A' + (character-'a'));
else
addch(character);
} while (character != '.'); // пока введенный символ не точка
return 0;
}// работает в https://www.onlinegdb.com/ #include <ncurses.h>