Presentation is loading. Please wait.

Presentation is loading. Please wait.

ECE 103 Engineering Programming Chapter 57 Terminal Control Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material.

Similar presentations


Presentation on theme: "ECE 103 Engineering Programming Chapter 57 Terminal Control Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material."— Presentation transcript:

1 ECE 103 Engineering Programming Chapter 57 Terminal Control Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material developed by Professor Phillip Wong @ PSU ECE

2 Syllabus conio Library Extended Features curses Library

3 2 conio Library conio is a library that provides I/O functions for enhanced console access.  Unbuffered keyboard input  Direct screen output conio is not part of the C90 or C99 standard. conio availability depends on the compiler vendor.  Microsoft Visual C/C++ → YES  GNU GCC → NO (but can be added via extra code)

4 3 Basic conio function list (from Wikipedia):  kbhit Determines if a keyboard key was pressed.  getch Reads a character directly from the console without buffer and without echo.  getche Reads a character directly from the console without buffer but with echo.  ungetch Puts the character back into the keyboard buffer.

5 4  cgets Reads a string directly from the console.  cscanf Reads formatted values directly from the console.  putch Writes a character directly to the console.  cputs Writes a string directly to the console.  cprintf Formats values and writes them directly to the console.

6 5 Extended Features Some versions of conio also support:  Setting the text cursor position  Setting foreground and background text colors  Clearing the text screen Availability depends on the compiler vendor.  Microsoft Visual C/C++ → NO (but can be added)  GNU GCC → NO (but can be added)

7 6 curses Library curses is a terminal control library originally designed for Unix-like systems. It is very comprehensive and supports text windows and keyboard/mouse control. Free implementations are available for:  Microsoft Visual C (pdcurses)  Cygwin+GCC (ncurses and pdcurses)  Linux (ncurses)  OS X (ncurses)


Download ppt "ECE 103 Engineering Programming Chapter 57 Terminal Control Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material."

Similar presentations


Ads by Google