#include <stdio.h>
#include <curses.h>
int main () {
int y, x;
getyx( curscr, y, x);
printf("x=%i, y=%i", x, y);
return 0; }
gcc a.c -lcurses -o a
x=-1, y=-1
Why?
#include <stdio.h>
#include <curses.h>
int main () {
int y, x;
getyx( curscr, y, x);
printf("x=%i, y=%i", x, y);
return 0; }
gcc a.c -lcurses -o a
x=-1, y=-1
Why?
Maybe you should call initscr();
before trying to use curses ?
#include <stdio.h>
#include <curses.h>
int main (void)
{
int y = 0, x = 0;
initscr();
getyx(curscr, y, x);
printw("x = %d, y = %d", x, y);
refresh();
getchar();
endwin();
return 0;
}
You'll find that reading at least some of the documentation for a programming library is time well invested, e.g. http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/