#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<string.h>



//字符串copy操作

//字符串copy函数
void copy_str21(char *from,char *to)
{
    for (; *from != '\0'; from++, to++)
    {
        *to = *from;
    }
    *to = '\0';
    return;
}
void copy_str22(char *from,char *to)
{
    while(*to++ = *from++);
}
int main()
{
    char *from ="abcdefg";
    char buf2[100];
    /*copy_str21(from,buf2);
    printf("buf2:%s\n",buf2);*/
    copy_str22(from, buf2);
    printf("buf2:%s\n", buf2);
    system("pause");
    return 0;
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2022-01-04
  • 2021-09-11
猜你喜欢
  • 2022-12-23
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-02
相关资源
相似解决方案