Avinash Sonawane PICT Pune Facebook <http://www.facebook.com/avinash.sonawane1990> Twitter <http://www.twitter.com/SonawaneAvinash>
On Thu, Jul 28, 2011 at 12:24 PM, Rahul Gaur <[email protected]> wrote: > > > On Thu, Jul 28, 2011 at 11:43 AM, Avinash Sonawane < > [email protected]> wrote: > >> Sir, >> Since this is my first encounter with GCC, I am totally a newbie. >> When I tried to run the following program using GCC it gave me some >> errors. >> >> Program : >> >> # include <stdio.h> >> # include <conio.h> >> >> void main() >> { >> clrscr(); >> printf("First program using GCC"); >> getch(); >> } >> >> Errors: >> >> avinash@titanic:~/Documents/C$ gcc first.c >> first.c:2:20: fatal error: conio.h: No such file or directory >> compilation terminated. >> >> When I remove conio.h header file it gave me errors regarding clrscr() and >> getch() since these two functions are defined in conio.h >> >> So my questions are: >> 1) How to clear the output screen (replacement of clrscr() ) in GCC ? >> 2) Is there any similar kind of replacement for getch() too ? >> 3) Why conio.h doesn't work in GCC ? >> >> Avinash Sonawane >> PICT Pune >> Facebook <http://www.facebook.com/avinash.sonawane1990> >> Twitter <http://www.twitter.com/SonawaneAvinash> >> >> -- >> Mailing list guidelines and other related articles: >> http://lug-iitd.org/Footer > > > Hi, > You can try out Ncurses library [0] if you want to use getch() and you can > use this system("clear); instead of clrscr(). > Is this (Ncurses library) included in default GCC package ? I want to have a replacement for getch() from within the default GCC itself. And thank you for system() though I haven't tried it as program is still buggy. > > >> See if this is on any help >> >> > >> #include<stdio.h> >> >> void main() >> >> { >> >> system("clear"); >> >> printf("hello World \n"); >> >> getchar(); >> >> } >> >> > > [0]-http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/scanw.html > Ncurses Intro-http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/intro.html > > -- > > ------------------------------------------------------------------------------------------------------- > *Regards* > *Rahul Gaur* > irc : iamaregee2 > blog : aregee.wordpress.com > fb: http://facebook.com/iamaregee > > > -- > Mailing list guidelines and other related articles: > http://lug-iitd.org/Footer > -- Mailing list guidelines and other related articles: http://lug-iitd.org/Footer
