strcpy函数
char *strcpy(char *dest, const char *src);
功能:将后面的字符串拷贝到前边
参数:char*传递地址
返回:返回dest
注意:dest的空间足够大,dest不能传递常量的地址
地址:数组名 字符串常量
const:可以传递常量的地址、变量的地址
数组在越界访问时不会报错!!!
1 #include <stdio.h>
2 #include <string.h> //strcpy函数需要一个string.h的头文件
3
4 int main(int argc, const char *argv[])
5 {
6 char a[32] = "helloworld";
7 char b[] = "bei";
8 int i = 0;
9
10 while(b[i] != '