#include<iostream>
using namespace std;


int main() {
     char ca1[100] = "hello";
     char ca2[] = "world";
    strcat_s(ca1, ca2);   
    //你没错,目前的vs版本必须用strcat_s
    //且strcat_是只接受1个函数(char)
    //不能是const char(这是两个)
    //右边也不能是{"hello","world"}
    //只能是一个
    cout << ca1 << endl;
    char c[100];
    strcpy_s(c, ca1);
    cout << c << endl;  

        return 0;
}
最后修改:2022 年 12 月 05 日
如果觉得我的文章对你有用,请随意赞赏