catching the alphabets through getc during run-time.
while(getc(stdin)!=EOF);
will get the character from the terminal until a CTRL + D signal is passed. With the help of getc, i can oly process the character after a enter is pressed i.e till the Enter key is pressed, it is keepon buffering the input :( Is there any way to process each character during run-time i.e. before pressing Enter key ? Thanks Chansanle |
You would need to enable non-blocking input to accomplish your goal. You can set this up yourself or rely on the ncurses library.
To set this up yourself, you would need to do something similar to the following: Code:
#include <stdio.h> |
Thanks for the support
hi dwhitney67,
Thanks a lot for your guidance and help. Now i came to know about the attributes of the terminal and how to manipulate using setattr and getattr. Will do the remainning job for the parser. Due to this non-blocking input, now i can implement a simple CLI parser :) |
All times are GMT -5. The time now is 06:32 PM. |