C language - some trivial knowledge summary

A binary zero, meaning all meaning -00000000000000

    1. a value of zero

    2. string end marker '\ 0'

    3. The null pointer NULL

        NULL essence, is zero, and this does not represent the number zero zero, zero and represents the number of memory cells.

        We defined the computer, the contents of the storage unit to zero as the number of readable, not writable.

Method II width designation input .scanf

scanf("%2s", &x);

Wherein the assignment represents a 2 percent sign behind the first two characters from the keyboard to input x

III. Use puts contents output to the screen

the puts ( " Enter the card points: " );

Four .atoi function (in <stdlib.h> library file)

atoi string is converted into an integer function

 Five .C language strings storage

 

char s = "shatner"

 

C language strings of the example will be read as a character array

The computer will read one by one all the elements in the array of characters, until he came \ 0

When setting up an array of characters, how many more to set an end \ 0 use.

The disadvantage is you have created for the string constants can not be modified, character array can be modified.

 

Guess you like

Origin www.cnblogs.com/renren-study-notes/p/11586645.html