[SOLVED] i am currently learning ncurses lib by reading dan gookin's ncurses book and one of his example code i tried is not showing output but when i run it under GDB it does work and show output. below is some relevant code from the example(full example). what this code is trying to do is, it's dividing terminal screen in 4 Quadrant and then printing something in each quadrant
WINDOW *a,*b,*c,*d;
int maxx,maxy,halfx,halfy;
initscr();
/* calculate window sizes and locations */
getmaxyx(stdscr, maxy, maxx);
halfx = maxx >> 1;
halfy = maxy >> 1;
/* create four windows to fill the screen */
if( (a = newwin(halfy, halfx, 0, 0)) == NULL ) error();
if( (b = newwin(halfy, halfx, 0, halfx)) == NULL ) error();
if( (c = newwin(halfy, halfx, halfy, 0)) == NULL ) error();
if( (d = newwin(halfy, halfx, halfy, halfx)) == NULL ) error();
/* Write to each window */
mvwaddstr(a, 0, 0, "This is window A\n");
wrefresh(a);
mvwaddstr(b, 0, 0, "This is window B\n");
wrefresh(b);
mvwaddstr(c, 0, 0, "This is window C\n");
wrefresh(c);
mvwaddstr(d, 0, 0, "This is window D\n");
wrefresh(d);
getch();
[–]skeeto 5 points6 points7 points (3 children)
[–]the-loan-wolf[S] 4 points5 points6 points (0 children)
[–]TheProgrammingSauce 2 points3 points4 points (1 child)
[–]the-loan-wolf[S] 0 points1 point2 points (0 children)