1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > c语言字符串英文 C语言字符串函数大全(国外英文资料).doc

c语言字符串英文 C语言字符串函数大全(国外英文资料).doc

时间:2018-07-12 23:41:12

相关推荐

c语言字符串英文 C语言字符串函数大全(国外英文资料).doc

C语言字符串函数大全(国外英文资料)

C语言字符串函数大全(国外英文资料)

It's all the same -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

The C language string function is large

The function name: stpcpy

Work energy: copy one string to another

Using the method: char * destin (char * source);

Application:

# include < stdio, h >

# include < string. H >

Intmain (void)

{

Charstring [10].

Char * str1 = "abcdefghi";

Stpcpy (string, str1);

Printf (" % s \ n ", string);

Return0;

}

The function name: strcat

Work energy: string splicing functions

Method: char * destin (char * source);

Application:

# include < string. H >

# include < stdio, h >

Intmain (void)

{

Chardestination [25];

A char * blank = "c =" c + + ", * Borland = "Borland";

Strcpy (destination, Borland);

Strcat (destination, blank);

Strcat (destination, c);

Printf (" % s \ n ", destination);

Return0;

}

It's a very real thing, and it's a real thing

The function name: STRCHR

Work ability: find the first match of a given character in a string

Method: char * STRCHR (char * STR, charc);

Application:

# include < string. H >

# include < stdio, h >

Intmain (void)

{

Charstring [15].

Char * PTR, c = 'r';

Strcpy (string, "Thisisastring");

PTR = STRCHR (string, c);

If (PTR)

Printf (" Thecharacter % cisatposition: % d \ n ", c, ptr-string);

The else

Printf (" Thecharacterwasnotfound \ n ");

Return0;

}

The function name: STRCMP

Work energy: crosstalk comparison

Use: intstrcmp (char * str1, char * str2);

Look at the Asic code, str1, > str2, return value >, 0; The two strings are equal, and they return 0

Application:

# include < string. H >

# include < stdio, h >

Intmain (void)

{

Char * buf1 = "aaa", * buf2 = "BBB", * buf3 = "CCC";

Intptr;

PTR = STRCMP (buf2 buf1);

If (PTR > 0)

Printf (" buffer2isgreaterthanbuffer1 \ n

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。