#include <stdio.h>
#include <stdlib.h>
#include <curses.h>
int main(int argc, char *argv[]){
move(12, 6);
printf("hello world !");
return 0;
}
The move
function gives an error.
#include <stdio.h>
#include <stdlib.h>
#include <curses.h>
int main(int argc, char *argv[]){
move(12, 6);
printf("hello world !");
return 0;
}
The move
function gives an error.
move
returns an error (ERR
is -1
) because curses was not initialized, e.g., using initscr
.
That printf
will do nothing useful in curses; you should replace that with printw
(and unless your program waits for input, e.g., by calling getch
, will exit immediately).
The program also should call endwin
(to undo the screen-initialization, making the terminal work properly).