need info on current curser postion.

Hi All,

I have written the below code to know the current curser position. The problem with this code is - it gives me window size properly but whn it comes to current curser position then it gives (0,0) as x,y co-ordinate eventhough my curser is somewhere middle on command line interface.

So could you please tell me that whats the purpose of getyx(). If it is to know current curser position then why does it always give me 0,0 as x,y co-ordinate?
////////////////////////////////////////////////////
initscr();
getmaxyx(stdscr, row, col);
getyx(stdscr, y, x);
endwin();
////////////////////////////////////////////////////

Thanks in advance
Swapnil