Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Ncurses

DZone's Guide to

Ncurses

·
Free Resource

#include 
  
   

int main() {

   int c;
   WINDOW *config_win;

   initscr();
   cbreak();
   noecho();

   config_win = newwin(10,20,1,1);
   mvwaddstr(config_win, 1,1, "test");

   while (c = wgetch(config_win)) {
      switch(c) {
         case 'a':
         delwin(config_win);
         config_win = newwin(10,20,1,1);
         mvwaddstr(config_win, 1,1, "print this");
         wrefresh(config_win);
         break;

         default:
         delwin(config_win);
         config_win = newwin(10,20,1,1);
         mvwaddstr(config_win, 1,1, "hello");
         wrefresh(config_win);
         break;
      }
   }

   endwin();
}


  
Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}