strcmp-- calling library functions strcpy and quick operation array of characters

Header file #include <cstring>

copy

strcpy:
char A [10], b [10];
strcpy (a, b);
the b copied to a, i.e. a = b.

Compare

strcmp:
char A [10], B [10]
strcpy (A, B);
if a = b returns 0, a> b returns a positive number, a <b returns a negative
magnitude comparison front to back a relatively past, If the same or different on the back until relatively complete, if different immediately return a result, the comparison is the ASCII value of the character.

Published 127 original articles · won praise 113 · views 110 000 +

Guess you like

Origin blog.csdn.net/z2431435/article/details/104594923