//_39_字符串指针
//_39_main.cpp
//将字符串a复制到字符串b
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main()
{
char a[]="I am a student.";
char b[20];
char *p1,*p2;
p1=a;//将数组a的首地址赋给字符型指针p1
p2=&b[0];
for(;*p1!='\0';p1++,p2++)
*p2=*p1;
*p2='\0';
printf("string a is : %s\n",a);
printf("string b is : ");
for(int i=0;b[i]!='\0';i++)
printf("%c",b[i]);
printf("\n");
system("pause");
return 0;
}