5-3

xiaoxiao2021-03-06  53

#include

#include

/ *

Realize Strcat.Strcat (S, T) with pointer mode to copy t directed to the string tail of the point

* /

Int strat (char * s, char * t)

{

IF (s == null) return -1;

While (* s! = '/ 0')

S ;

While (* s = * t )

;

Return 0;

}

Int main (void)

{

Char a [1000] = {"Hello"};

Char * b = "world";

IF (STRCAT (A, B)! = 0)

Return -1;

Printf ("a is:% s", a);

System ("pause");

Return 0;

}

转载请注明原文地址:https://www.9cbs.com/read-115594.html

New Post(0)