📄 10.19.2.cpp
字号:
//形参用字符指针变量
#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)
{
for(;*from!='\0';from++,to++)
*to=*from;
*to='\0';
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -