conio.h, who's got it, who doesn't? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

conio.h, who's got it, who doesn't?

guesstguesst Posts: 46Member
I wnat to write some code using conio.h but I'm not sure all compilers have it, and I'd hate to write machine dependent code for as dinky as my code's going to be. Does anyone know which of the following platforms/compilers can use conio.h:
Mingw32
VC++
Borland
Linux (gcc)
Macintosh
any others?

Comments

  • stoberstober Posts: 9,765Member ✭✭✭
    : I wnat to write some code using conio.h but I'm not sure all compilers have it, and I'd hate to write machine dependent code for as dinky as my code's going to be. Does anyone know which of the following platforms/compilers can use conio.h:
    : Mingw32
    : VC++
    : Borland
    : Linux (gcc)
    : Macintosh
    : any others?
    :


    I know vc++ and borland has it. Since conio.h contains non-standard functions there is no guarentee that any other compilers support it, and those that do may implement it differently. There's probably a couple hundred C compilers. Some of them are listed in a different thread that was posted today.

  • fatestreamfatestream Posts: 2Member
    : I wnat to write some code using conio.h but I'm not sure all compilers have it, and I'd hate to write machine dependent code for as dinky as my code's going to be. Does anyone know which of the following platforms/compilers can use conio.h:
    : Mingw32
    : VC++
    : Borland
    : Linux (gcc)
    : Macintosh
    : any others?
    :
    Hey, if your writing this for windows (I assume you are, as conio is windows only, and if youre doing linux then look for ncurses) you might give this a try:

    home.comcast.net/~silverphyre673/index.html

    Goto the coding section and get the console code. I wrote it, and it lets you do all the things that everyone wants from conio: format input (replace passwords with *), color text/background, and position cursor. However, it requires use of windows.h, so if performance is hugely neccesary, you'll have to search around. Please keep in mind though that its not perfect, and you will probably be better off not using the Read and Write functions (I think I'm going to remove them). But it should work fine just using regular cin and cout, if I'm not mistaken.

    Thanks, good luck!
  • guesstguesst Posts: 46Member
    [b][red]This message was edited by guesst at 2005-3-30 12:16:46[/red][/b][hr]
    [b][red]This message was edited by guesst at 2005-3-30 12:16:9[/red][/b][hr]
    : Hey, if your writing this for windows (I assume you are, as conio is windows only, and if youre doing linux then look for ncurses) you might give this a try:
    :
    : home.comcast.net/~silverphyre673/index.html

    Thanks for the link, but conio.h also works in DOS under the borland compiler. I know that nobody writes in DOS nowadays, but I have my reasons for wanting to be as backwards and forwards compatible as possible.

    Does Linux have something so that the gotoxy() and other common conio.h function are approximated, or is it just a lost cause?

    Also, is hoping that Macintosh or Sun computers can have some version of those functions just wishing too much?




  • dennisparkerdennisparker Posts: 478Member
    I know that nobody writes in DOS nowadays, but I have my reasons for wanting to be as backwards and forwards compatible as possible.

    [green]
    I program in the DOS environment at work at it looks like I will continue that for years to come. I would assert that few people write DOS programs for the desktop PC anymore, but DOS programming is the best choice for certain types of embedded programming. Now allow me to duck before the Linux god strikes out. :-)
    [/green]
  • stoberstober Posts: 9,765Member ✭✭✭
    : I know that nobody writes in DOS nowadays, but I have my reasons for wanting to be as backwards and forwards compatible as possible.
    :
    : [green]
    : I program in the DOS environment at work at it looks like I will continue that for years to come. I would assert that few people write DOS programs for the desktop PC anymore, but DOS programming is the best choice for certain types of embedded programming. Now allow me to duck before the Linux god strikes out. :-)
    : [/green]
    :


    I agree. MS-DOS is a lot better at real-time programming and in some circulstances can run rings around linux. The only real problem I have with MS-DOS is the limited amount of RAM.
  • LundinLundin Posts: 3,711Member
    : : [green]
    : : I program in the DOS environment at work at it looks like I will continue that for years to come. I would assert that few people write DOS programs for the desktop PC anymore, but DOS programming is the best choice for certain types of embedded programming. Now allow me to duck before the Linux god strikes out. :-)
    : : [/green]
    : :


    Regarding embedded systems, I must say that you are using DOS in a very odd way. The usual way is to let a microcontroller handle the real-time, and Windows to handle the user. The Windows program can communicate with the micro if it needs to configure things etc. Sence the user is so incredible slow, it is better to try not to involve him in the real-time application at all.

    In those situations where the user must act interactive in real-time, for example if he is stearing something, then you add buttons and a LCD to the microcontroller, you don't throw a PC at him :-)


    :
    : I agree. MS-DOS is a lot better at real-time programming and in some circulstances can run rings around linux. The only real problem I have with MS-DOS is the limited amount of RAM.
    :

    When there is need for real-time, you don't use a PC with desktop-ish Linux, you use an embedded version of it. That one will run in rings around DOS and still be multitasked. And there are also many RTOS that will run in rings around embedded Linux...
  • dennisparkerdennisparker Posts: 478Member
    : In those situations where the user must act interactive in real-time, for example if he is stearing something, then you add buttons and a LCD to the microcontroller, you don't throw a PC at him :-)

    I agree. The niche that I have found, and am referring too, is control systems. The RAM limitations of the DOS environment aren't really an issue as a practical matter because the programs aren't that big. Any required "multi-tasking" is handled with seperate task specific controllers whose functions are coordinated by the DOS target (dedicated motion controllers, motor drives, and I/O handlers).

    It is true that our chief competitors are tending to incorporate touch screens and Windows into their machinery, but in my opinion it is [red]much[/red] easier to operate machinery when you give the user a joystick and buttons to control the equipement. It frees up the eyes and is more intuitive, but there is also something else. I have always thought it looked "cheesy" for a $70,000-$140,000 robotic machine to sport a display running MS Windows. Almost like the programmer/design team couldn't figure out the HMI on their own, so they ran to Mr. Gates and his crew to help them out.

    Now I better duck again before you throw your PC at me. ;-)
Sign In or Register to comment.