feedback on code design

  • Thread starter krastavicakrastavica
  • Start date
K

krastavicakrastavica

Guys please, i only need answer on, what you do when you need a
function such as getch() or similliar that is part of conio.h or non-
standart header, and you really need it. Would you code similliar
function on your own or what would you do?
Thanks
 
J

Jorgen Grahn

I read its bad to use conio.h, and i use getch() from that header. If
i have a new project that needs such function, is it good i to write
it on my own? What would the mass of programmers do?

Please don't:
- jump into a thread with a new, completely unrelated question
- ... without changing the subject
- post the same question many times (this one appeared in at least
one other thread I'm reading)

/Jorgen
 
G

Guest

Guys please, i only need answer on, what you do when you need a
function such as getch() or similliar that is part of conio.h or non-
standart header, and you really need it. Would you code similliar
function on your own or what would you do?
Thanks

if you need it then you use conio.h. I'd probably hide it behind some OS specific library. Maybe even rename it. Hopefully then moving to another would only require changes in a few places.
 
N

Nobody

Guys please, i only need answer on, what you do when you need a function
such as getch() or similliar that is part of conio.h or non- standart
header, and you really need it. Would you code similliar function on your
own or what would you do? Thanks

Use the curses API. There are implementations for all of the common
platforms. Unix versions use control codes and escape sequences from the
terminfo database, the Windows version uses the Windows console API. You
can use a Unix version on Windows if you want to talk to a terminal or
terminal emulator (either via serial or network) rather than a Windows
console.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top