習題11 4 字串的連線 15分

2021-10-06 04:37:14 字數 858 閱讀 3923

本題要求實現乙個函式,將兩個字串連線起來。

函式介面定義:

char

*str_cat

(char

*s,char

*t )

;

函式str_cat應將字串t複製到字串s的末端,並且返回字串s的首位址。

裁判測試程式樣例:

#include

#include

#define maxs 10

char

*str_cat

(char

*s,char

*t )

;int

main()

, str2[maxs]=;

scanf

("%s%s"

, str1, str2)

; p =

str_cat

(str1, str2)

;printf

("%s\n%s\n"

, p, str1)

;return0;

}/* 你的**將被嵌在這裡 */

輸入樣例:

abc

def

輸出樣例:

abcdef

abcdef

char

*str_cat

(char

*s,char

*t )

習題11 4 字串的連線 15分

本題要求實現乙個函式,將兩個字串連線起來。函式介面定義 char str cat char s,char t 函式str cat應將字串t複製到字串s的末端,並且返回字串s的首位址。裁判測試程式樣例 include include define maxs 10 char str cat char s...

習題11 4 字串的連線 15分

本題要求實現乙個函式,將兩個字串連線起來。char str cat char s,char t 函式str cat應將字串t複製到字串s的末端,並且返回字串s的首位址。include include define maxs 10 char str cat char s,char t int main...

習題11 4 字串的連線 15分

本題要求實現乙個函式,將兩個字串連線起來。函式介面定義 char str cat char s,char t 函式str cat應將字串t複製到字串s的末端,並且返回字串s的首位址。裁判測試程式樣例 include include define maxs 10 char str cat char s...