>  system("stty raw");

> Please refer man page of stty for details.

Interesting.

@Avinash, conio.h was provided by DOS based C compilers to implement
features available for the DOS "terminal" (like clrscr() or getch() ).
It is not part of ISO C and is also not required by POSIX [1]. The
linux terminal, I would claim, is more versatile than your DOS prompt
of the bygone era (although I will not try to substantiate that claim
here). The conio-like functionalities for the terminal is provided by
a dedicated library called ncurses [2,3] (as already pointed out). The
reason to separating terminal properties from the compiler could
partly be because of the huge array of systems gcc supports (imagine
gcc targeting embedded devices without monitors).

A couple of suggestions:
1. You don't need a getch() at the end of your program if you use a
(dedicated) terminal to run your program in. That was required by DOS
based C compilers because the view would switch back to the editor
immediately after executing the code.
2. Use "\n" (for a new line character) at the end of your prints, e.g.
    printf("First program using gcc\n");


Hope this helps,
Sharad

[1] http://en.wikipedia.org/wiki/Conio.h
[2] http://www.gnu.org/s/ncurses/
[3] http://en.wikipedia.org/wiki/Ncurses

-- 
Mailing list guidelines and other related articles: http://lug-iitd.org/Footer

Reply via email to