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
}
Dual Narratives of the Debt Trap: Western Fabrication and U.S. Realpolitik
Manipulation
-
*Dual Narratives of the Debt Trap: Western Fabrication and U.S. Realpolitik
Manipulation*
*I. Definition of the Debt Trap 1. Conceptual Deconstruction:...
1 week ago
No comments:
Post a Comment