2010-08-01 5 views
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= -1 -1

X = -1, Y를 반환 getyx -1

왜?

답변

4

아마 저주를 사용하기 전에 initscr();으로 전화해야합니까?

#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; 
} 

당신은 독서 적어도 프로그래밍 라이브러리에 대한 문서의 일부를 찾을 수는 시간이 아니라 투자, 예를 들어, http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/

+0

예 ... – tt123