willsun888
7/10/2013 - 7:03 AM

(编程技巧)拷贝字符串

(编程技巧)拷贝字符串

void str_copy(char *a,const char *b,int len) {  //拷贝字符串 a = b  
    for (;len > 0; --len, ++b,++a) {  
        *a = *b;  
    }  
    *a = 0;  
}