Home > Back-end >  Bosses help children the final assignment
Bosses help children the final assignment

Time:01-05

Input from the keyboard two strings a and b, if the length of b is less than 10, will be behind the link to a and b output or output b; (do not use the string library function)

CodePudding user response:

Reference:
 # include & lt; Stdio. H> 
Char * str_lnk (char * p, char * q);

Int main (int arg c, char * argv [])
{
Char *=new cha char [20], * CHB=new char [10].
Gets (cha);
Gets (CHB);

Puts (str_lnk (cha, CHB));

system("pause");
return 0;
}

Char * str_lnk (char * p, char * q)
{
Char * t;
T=q;
While (* t) t++;
If (t - q<10) {
T=p;
While (* t) t++;
Q) while (* * * q++ t++=;
* t='\ 0';
return p;
}
The else
return q;
}
  • Related