Home > Article > Backend Development > C language displays content on the screen
puts("php中文网");Here is an unfamiliar vocabulary
puts
, which is used to let the computer display text on the screen. "Displaying text on the screen" is called Output;
Each text is a character (Character) ;
The combination of multiple characters is a character sequence, called string (String) .
" "
surrounded, php中文网
is nothing, the computer does not recognize it," PHP Chinese website "
is the string. ( )
. respectively.
and .
represent the end of a sentence, while in C language, use ;
to represent the end of a statement. puts("php中文网")
expresses the complete meaning and is a complete statement. You need to add ;
at the end to indicate that the current statement is over. puts( )
Commands the computer to output a string;
"C Language Chinese Network"
is the content to be output;
;
indicates the end of the statement.
puts("php中文网");The brackets, double quotes, and semicolons in
are all English symbols, and they are Half-width, so you need to switch to the English half-width input method when writing code, as shown in the following figure: Chinese semicolon; and English semicolon;;
Chinese commas , and English commas ,;
Chinese colon : and English colon :;
Chinese brackets () and English brackets ();
Chinese question mark? and English question mark ?;
Chinese single quotation mark '' and English single quotation mark ' ';
Chinese double quotation marks " " and English double quotation marks " ".
C language Chinese website! Hello C,I like!
Full-width input:C language Chinese website! Hello C,I like!
The other most important point is: the Unicode encoding corresponding to the "same" character is different in the full-width and half-width states.#include第 1~3 行、第 5~6 行是固定的,所有C语言源代码都必须有这几行。你暂时不需要理解它们是什么意思,反正有这个就是了,以后会慢慢讲解。int main() { puts("php中文网"); return 0; }
{ }
之间才有效。#includeint main(){ puts("php中文网"); return 0;}
颜色和行号是笔者自己加上去的,主要是为了让大家阅读方便,明显地区分各个语句,C语言本身没有对这些作要求,你可以随意设置各个字符的颜色,也可以没有颜色。
The above is the detailed content of C language displays content on the screen. For more information, please follow other related articles on the PHP Chinese website!