发布网友 发布时间:2022-04-25 19:37
共4个回答
热心网友 时间:2022-06-16 19:08
// 介绍两种方法,源程序如下://////////////////////////////////////////////////////////////////////热心网友 时间:2022-06-16 19:08
#include<stdio.h>热心网友 时间:2022-06-16 19:09
char *strcat( char *strDestination, const char *strSource );wchar_t *wcscat( wchar_t *strDestination, const wchar_t *strSource );ParametersstrDestination Null-terminated destination string strSource Null-terminated source string LibrariesAll versions of the C run-time libraries.Return ValueEach of these functions returns the destination string (strDestination). No return value is reserved to indicate an error.RemarksThe strcat function appends strSource to strDestination and terminates the resulting string with a null character. The initial character of strSource overwrites the terminating null character of strDestination. No overflow checking is performed when strings are copied or appended. The behavior of strcat is undefined if the source and destination strings overlap.wcscat is the wide-character version of strcat. The arguments and return value of wcscat are wide-character strings. These two functions behave identically otherwise.热心网友 时间:2022-06-16 19:10
你好,比如下边这个#include <string>#include <iostream>using namespace std;void main(){ char a[50],b[50]; cin>>a>>b; cout<<strcat(a,b)<<endl;; }