i just have one last question before i go on learning some more...

i have coded a simple hello word but in curses... now my problem is that it wont print out the hello word...
but if i was to take out endwin(); from the code then it will print but yet my terminal starts to act as if it was in a loop but then again it prints out "hellow word"... can anyone tell me why.. ?

#include <curses.h>

int main()
   initscr();   //starts the loop
     printw("hello word");   //prints hello word
    refresh();   //prints it to the real screen // stdscr
     endwin();  //ends curses
im trying to figure it out but ... i dont know what is going on.. so alittle help would be great ...... thanx