说明
语法/原型:
char* strcpy(char* strDestination, const char* strSource);
参数说明:
- strDestination:目的字符串。
- strSource:源字符串。
strcpy() 会把 strSource 指向的字符串复制到 strDestination。
必须保证 strDestination 足够大,能够容纳下 strSource,否则会导致溢出错误。
返回值: 目的字符串,也即 strDestination。
例子
char str1[] = "We are csdn!";
char str2[] = "Hello!";
strcpy_s(str1, str2); //str = Hello!