944,058 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 34961
  • C RSS
You are currently viewing page 1 of this multi-page discussion thread
Jan 27th, 2005
0

substitute for conio.h in linux

Expand Post »
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
saurabh_s is offline Offline
1 posts
since Nov 2004
Jan 27th, 2005
0

Re: substitute for conio.h in linux

Have a look at the ncurses library
http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/
K.
ZuK
Reputation Points: 11
Solved Threads: 0
Light Poster
ZuK is offline Offline
29 posts
since Oct 2004
Jan 27th, 2005
-1

Re: substitute for conio.h in linux

Remove clrscr, you probably don't need it.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Jan 28th, 2005
-1

Re: substitute for conio.h in linux

@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.
ZuK
Reputation Points: 11
Solved Threads: 0
Light Poster
ZuK is offline Offline
29 posts
since Oct 2004
Jan 28th, 2005
0

Re: substitute for conio.h in linux

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.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Jan 28th, 2005
0

Re: substitute for conio.h in linux

Quote 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
ZuK
Reputation Points: 11
Solved Threads: 0
Light Poster
ZuK is offline Offline
29 posts
since Oct 2004
Jan 28th, 2005
0

Re: substitute for conio.h in linux

>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.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Jan 28th, 2005
-1

Re: substitute for conio.h in linux

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.

Quote ...
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.
ZuK
Reputation Points: 11
Solved Threads: 0
Light Poster
ZuK is offline Offline
29 posts
since Oct 2004
Jan 28th, 2005
0

Re: substitute for conio.h in linux

>You should have said
I did, though without spelling it out for the slow people such as yourself:
Quote 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.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Jan 28th, 2005
0

Re: substitute for conio.h in linux

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
Team Colleague
Reputation Points: 121
Solved Threads: 57
Posting Virtuoso
kc0arf is offline Offline
1,629 posts
since Mar 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
This thread is currently closed and is not accepting any new replies.
Previous Thread in C Forum Timeline: Pointers
Next Thread in C Forum Timeline: Slot machine program





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC