ncurses refresh()

i have read in one of links, there its documented

but i am using following code

 int main ()
 {
     char ch;
     initscr();
     printw("Enter a char :");
     ch=getch();
     printw("You Entered '%c' ",ch);
     getch();
     endwin();
     return 0;
}
  

the code does not have

but have one getch() extra,its showing out put on the window.

without that getch() the program is getting terminated in falsh so we cant observe the out put .
my question is how its printing o/p on window without refresh().

please reply for this

As specified in the rules, you're not supposed to bump threads.

A little googling brought me to the curses functions echo() and noecho(), which enable and disable local echo respectively.