Conio.h alternative for mac5/4/2023 To get to a point where a single key-stroke can be read and the program terminated cleanly, you have to do a good deal of work on Unix (OSX, Linux). (Good hint from dmckee - it helped get the link line out of acidzombie24, which was important.) So, your code is invoking undefined behaviour by calling curses routines before the correct initialization is done, leading to the crash. Now, there appears, on your system, to be an actual function getch() in the curses library, but it expects stdscr to be set up, and that is done by the curses initialization functions ( initscr() and relatives), and that is signally not done by your code. Specifically, as a macro in, we find: #define getch() wgetch(stdscr) Hint: OSX and Linux are not the same as Windows. Have you looked in to see what the getch() function does?
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |