10.19.1.cpp
来自「c入门代码大全」· C++ 代码 · 共 24 行
CPP
24 行
#include<stdio.h>
int main()
{
void copy_string(char from[],char to[]);
char from[]="I am a teacher.";
char to[]="You are a student.";
char *a=from,*b=to;
printf("string a=%s\nstring b=%s\n",a,b);
printf("copy string a to string b:\n");
copy_string(a,b);
printf("\nstring a=%s\nstring b=%s\n",a,b);
getchar();
}
void copy_string(char from[],char to[])
{
int i=0;
while(from[i]!='\0')
{
to[i]=from[i];
i++;
}
to[i]='\0';
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?