程序的错误在哪里啊
#include <iostream>using namespace std;
int main()
{
char str1[]= "I love China !",str2[5],*p1,*p2;
p1=str1;
p2=str2;
for(; *p1!= '\0'; p1++,p2++)
p2=p1;
*p2='\0';
p1=str1;
p2=str2;
cout << p1 << endl <<p2;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
char str1[]= "I love China !",str2[5],*p1,*p2;
p1=str1;
p2=str2;
for(; *p1!= '\0'; p1++,p2++)
*p2=*p1;
*p2='\0';
p1=str1;
p2=str2;
cout << p1 << endl <<p2;
return 0;
}
这两个的区别是什么啊,