Created
May 29, 2014 11:46
-
-
Save zsrinivas/365bb08ec80fe5188cfe to your computer and use it in GitHub Desktop.
eightnoteight's first program using ncurses
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Author: eightnoteight (Srinivas Devaki) | |
* Date : Thu May 29 5:11:57 PM | |
* Note : where ever you find this emoji, | |
for the god's sake i didn't | |
understand what that func would | |
do. if you know about it, please | |
exlain it to me. | |
*Contact: mr.eightnoteight [at] gmail [dot] com | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <assert.h> | |
#include <ctype.h> | |
#include <curses.h> | |
int main() | |
{ | |
char ch[15]="Hello WOrld!"; | |
/*INITIALISATIONS*/ | |
initscr(); /*start curses mode*/ | |
raw(); /*(:}:-|-:{:)*/ | |
keypad(stdscr, TRUE); /*(:}:-|-:{:)*/ | |
noecho(); /* without the noecho() the input | |
* from the keyboard gets printed | |
*/ | |
/*WORKPLACE*/ | |
printw("Normal Helloworld!\n"); | |
printw("%s\n", ch); | |
printw("Bold Helloworld!\n"); | |
attron(A_BOLD); /* whatever the output from now on will | |
* be printed in bold style | |
*/ | |
printw("%s\n", ch); | |
attroff(A_BOLD); /* Alas! the A_BOLD died */ | |
printw("Time to say Good Bye!\n"); | |
/*PACKING UP*/ | |
refresh(); /*(:}:-|-:{:)*/ | |
getch(); /* wait for the user input before | |
* ending yourself | |
*/ | |
endwin(); /*end curses mode*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment