Play around with the standard output

Play around with the standard output


In fact, this child should do the game.

terminal

English terminal called Terminal (that is, the black window), input and output C language command-line program is done in the terminal, things to enter the terminal, the terminal echo out to us, until we press under enter the contents of the input terminal and only then we write to our C language program.

Early terminal is a screen and keyboard, today is the application that called terminal on the computer. Terminal Inside there is something called the law of the line (line discipline), its role is to make explicit the character back to our input, but it will do the processing of some data (such as: the \ n converted to \ r \ n), Ctrl-C to abort the process into a character signal (signal).

Change the character color

C language has an escape sequence , \nnnrepresent any character value octal value represented in the ASCII table. There are also terminal escape sequences, specific content can see two links to articles beginning.

For example use \x1b[1;5;31;102mto set the foreground color to red, bright green background color, bold, and blinking. \x1bRepresentatives is ESCkey.

#include <stdio.h>

int main()
{
    printf("\x1b[1;5;31;102mHelloWorld\n");
    return 0;
}

Guess you like

Origin www.cnblogs.com/nobilis/p/11970232.html