strcat 函式的實現

2021-06-08 20:26:48 字數 412 閱讀 5856

/*

* name:xif

* coder:[email protected]

* time:08.22.2012

* function:char* my_strcat(char* pstr_1, char* pstr_2)

*/char* my_strcat(char* pstr_1, char* pstr_2)

/** 使指標pstr_1指向字串實參的末尾,即末尾的null('\0')字元

*/ while(*pstr_1)

/** 把引數字串pstr_2拷貝到引數字串pstr_1的末尾

*/ while(*pstr_1 = *pstr_2)

return ret_address;

}

實現strcat函式

strcat函式是將兩個字串進行連線。define crt secure no warnings include include include includechar strcat char dest,const char src dest i 0 return dest int main str...

c語言 實現Strcat函式

實現char my strcat char dest,char src 函式.返回 dest字串的位址。功能 將src指向的字串追加到dest指向字串的後面。例如 char dest 10 andef char src ghi my strcat 之後,dest指向的字串為 andefghi inc...

strcat 函式的用法

這幾天的一次程式練習中用到了strcat 函式,但也想到了一些問題。我們都知道strcat str,ptr 是將字串ptr內容連線到字串str後,然後得到乙個組合後的字串str,比如 str字串內容為 123456 0 ptr字串為 abc 0 那麼strcat str,ptr 後str內容為 12...