experiments

All kinds of coding experiments
Log | Files | Refs | Submodules

nc2.c (667B)


      1 #include <ncurses.h>
      2 
      3 int main(){
      4     initscr();
      5     raw();                      //  Does NOT let you exit program with Ctrl-C. use cbreak for exit functionality
      6     int testvar = 4;
      7     printw("This is bog standard string output %d", testvar);
      8     addch('a');                 // Writes chars to the screen.
      9     move(12, 13);               // Moves the cursor on the screen
     10     //   ^y  ^x
     11 
     12     mvprintw(15, 20, "Movement");   // Move cursor, then print at cursor.
     13     mvaddch(12,50, '@');            // Move cursor, then add character.
     14     getch();
     15     endwin();                   //  Frees the memory in the screen and closes ncurses. "destructor"
     16 
     17     return 0;
     18 }