字符串复制函数-简单

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void StringCopy(char* strSource, char* strDestination)
{
int i = 0;
while(*strSource!='\0')
{
*strDestination++ = *strSource++;
}
*strDestination = '\0';
}

int main()
{
char strS[] = "You are students";
char strD[50];
StringCopy(strS, strD);
//while(strD!='\0')
printf("%s\n", strD);
return 1;
}

 

posted @ 2020-12-15 22:23  bobo哥  阅读(587)  评论(0编辑  收藏  举报