ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
conio.h sounds like something out of the DOS world. For Linux you will need to use the termios API and/or the ncurses library instead. Time to start learning how to link with external libraries. For details, consult your local man pages.
--- rod.
I don't think that the OP needs anything like ncurses for this project.
It's just that when his friend rewrote the code, he appearantly used conio.h to clear the screen at the start and wait for a key press at the end (probably so that the terminal doesn't close when he launched it from a Windows GUI). Both of those functions are unnecessary and annoying for a Linux command-line app.
The error you show is not a run-time error message; its a compile-time message (and only a warning, at that). You can also get errors from the linker. C code usually doesn't emit error messages; it just crashes.
When looking at the manpage of a function, It's best to use "man 3 function-name" instead of "man function-name". By default, if there is a command with the same name, its manpage will be shown, but "3" tells it to look at C functions only.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.