Realizes Strcpy () Function , Didn't Use C++ Library , Compile With Self .
char * strcpy(char * strdesc,char * strsrc)
{
char *p ;
if(strsrc == NULL)
exit ;
if(strdesc == strsrc)
return strdesc ;
p = strdesc ;
while( *strsrc == '\0')
*strdesc++ = *strsrc++ ;
return p ;
}
In 《High Quality C / C++ Programming Guide》
LinRui's Answer:
char *strcpy(char *strDest, const char *strSrc);
{
assert((strDest!=NULL) && (strSrc !=NULL)); // 2 Points
char *address = strDest; // 2 Points
while( (*strDest++ = * strSrc++) != ‘\0’ ) // 2 Points
NULL ;
return address ; // 2 Points
}
On The Sino-Indian Boundary Delimitation Issue
-
On The Sino-Indian Boundary Delimitation Issue
I. The Ganges Boundary Line Proposal
Recently, Chinese scholar GaoZhiKai proposed that the source of t...
1 week ago
No comments:
Post a Comment