对字符串拷贝函数的优化
void stringcopy(char* from,char* to)
{
int i=0;
for(i=0;i<strlen(from);i++)
{
*(to+i) = *(from+i);
}
to[i]='\0';
}
void stringcopy2(char* from,char* to)
{
int i=0;
for(;*from!='\0';)
{
*to++ = *from++;
}
*to='\0';
}
void stringcopy3(char* from,char* to)
{
while( (*to = *from)!='\0' )
{
from++;
to++;
}
}
void stringcopy4(char* from,char* to)
{
while( (*to++ = *from++)!='\0' )
{
;
}
}
void stringcopy5(char* from,char* to)
{
while( (*to++ = *from++) );
}