C 语言字符串函数大全
函数名:stpcpy
功 能:
拷贝一个字符串到另一个
用 法:char*stpcpy(char*destin,char*source);
程序例:
#include<stdio.h>
#include<string.h>
intmain(void)
{
charstring[10];
char*str1="abcdefghi";
stpcpy(string,str1);
printf("%s\n",string);
return0;
}
函数名:strcat
功 能:
字符串拼接函数
用 法:char*strcat(char*destin,char*source);
程序例:
#include<string.h>
#include<stdio.h>
intmain(void)
{
chardestination[25];
char*blank="",*c="C++",*Borland="Borland";
strcpy(destination,Borland);
strcat(destination,blank);
strcat(destination,c);
printf("%s\n",destination);
return0;
}