tags:

views:

40

answers:

1
#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?

+5  A: 

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/

Paul R
example please...
tt123