substitute for conio.h in linux

Reply

Join Date: Nov 2004
Posts: 1
Reputation: saurabh_s is an unknown quantity at this point 
Solved Threads: 0
saurabh_s saurabh_s is offline Offline
Newbie Poster

substitute for conio.h in linux

 
0
  #1
Jan 27th, 2005
hi

i was compiling a program in linux , the program had conio.h file which is generally used in turbo c in windows. now the program is not compiling and giving errors.

so what is the substitute . as clrscr() cant work without this file.
Last edited by saurabh_s; Jan 27th, 2005 at 5:08 am. Reason: spelling mistake
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 29
Reputation: ZuK is an unknown quantity at this point 
Solved Threads: 0
ZuK ZuK is offline Offline
Light Poster

Re: substitute for conio.h in linux

 
0
  #2
Jan 27th, 2005
Have a look at the ncurses library
http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/
K.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,603
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 713
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: substitute for conio.h in linux

 
0
  #3
Jan 27th, 2005
Remove clrscr, you probably don't need it.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 29
Reputation: ZuK is an unknown quantity at this point 
Solved Threads: 0
ZuK ZuK is offline Offline
Light Poster

Re: substitute for conio.h in linux

 
0
  #4
Jan 28th, 2005
@Narue: This is ridiculous.
The Op is asking for a way to port a program from one OS to another and you are telling him to throw away a probably perfectly working program
and start to design from scratch.
If you don't have anything meaningful to say about the question you should leave it altogether. This kind of comments are not helpful at all.
We could argue about the usefulness of clearing the screen in a console application. But there sure are reasons to do it.
K.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: substitute for conio.h in linux

 
0
  #5
Jan 28th, 2005
no, all she says is that clrscr() is in almost all cases it is used used incorrectly and without being needed.

Its SOLE use is to clear the screen in console applications. BUT, console applications should NOT clear the screen, they should instead assume that the screen is not in any way under their control!

There are NO reasons for a console application to clear the screen. If you need total control of the screen you should not be writing a console application in the first place.
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 29
Reputation: ZuK is an unknown quantity at this point 
Solved Threads: 0
ZuK ZuK is offline Offline
Light Poster

Re: substitute for conio.h in linux

 
0
  #6
Jan 28th, 2005
Originally Posted by jwenting
There are NO reasons for a console application to clear the screen. If you need total control of the screen you should not be writing a console application in the first place.
I guess you are talking about programming in an environment with a GUI. But I am still using lots of programs from times
where no such thing as a GUI was available. In such an environment clrscr() was very useful to provide something that gets close to a GUI.
This thread is about porting not about redesign.
K
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,603
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 713
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: substitute for conio.h in linux

 
0
  #7
Jan 28th, 2005
>you are telling him to throw away a probably perfectly working program and start to design from scratch.
Were you using Google Translate to read my post in Danish via Urdu? I suggested removing one line, not throwing away the program and starting over. Try reading for comprehension sometime, it's amazing the things you can learn.

>But there sure are reasons to do it.
Yes, there are. But most of the time when looking at old Turbo C programs, this is how it's used:
  1. #include <conio.h>
  2.  
  3. void main() /* For added realism */
  4. {
  5. clrscr(); /* Silly and useless */
  6.  
  7. /* Program without clrscr here */
  8. }
Now, until the OP shows us that his use is one of the "valid" ones, I'm going to assume that his use is in the majority of clrscr calls, ie. unnecessary.

>If you don't have anything meaningful to say about the question you should leave it altogether.
All of my posts are meaningful. If you're too narrow-minded to understand what I'm saying, or too stupid to read my posts correctly, that's not my problem.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 29
Reputation: ZuK is an unknown quantity at this point 
Solved Threads: 0
ZuK ZuK is offline Offline
Light Poster

Re: substitute for conio.h in linux

 
0
  #8
Jan 28th, 2005
You should have said: Only if your program looks like this
  1. #include <conio.h>
  2.  
  3. void main() /* For added realism */
  4. {
  5. clrscr(); /* Silly and useless */
  6.  
  7. /* Program without clrscr here */
  8. }
throw away the clrscr().
I agree with that.

All of my posts are meaningful. If you're too narrow-minded to understand what I'm saying, or too stupid to read my posts correctly, that's not my problem.
I have checked some of your posts. It seems whenever someone has a different opinion you reply with an insult.
K.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,603
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 713
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: substitute for conio.h in linux

 
0
  #9
Jan 28th, 2005
>You should have said
I did, though without spelling it out for the slow people such as yourself:
Originally Posted by Narue
Remove clrscr, you probably don't need it.
>It seems whenever someone has a different opinion you reply with an insult.
Taken out of context (which is something you seem very good at) it probably does seem that way. Pick a post and link to the thread and I'll be happy to explain the lesson/merit of my reply. Provided someone has a reasonable opinion, I'm willing to debate in a civil manner.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 1,620
Reputation: kc0arf is a jewel in the rough kc0arf is a jewel in the rough kc0arf is a jewel in the rough 
Solved Threads: 51
Team Colleague
kc0arf kc0arf is offline Offline
Posting Virtuoso

Re: substitute for conio.h in linux

 
0
  #10
Jan 28th, 2005
Hello,

Narue strikes me as a very experienced programmer, and she also cuts to the chase on program design. I only hope that she dismisses remarks about her character, and uses her volunteer time here to maintain the high level of excellence her experience offers us.

This thread, however, is about the conino.h file, and it's technical uses. It will not turn into a character debate; and if anyone tries, I'll lock and we will all move on. The moderator staff will also torpedo any new threads that deal with character in public.

Christian
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC