用C自己写一个string copy函数 帮忙看看哪里写的不对
#include<iostream>using namespace std;
void stringcopy(char *p)
{
char *ps;
while(*p!='\0')
{
*ps=*p;
ps++;
p++;
}
cout<<ps<<endl;
}
void main()
{
char *p="abcdeffg";
stringcopy(p);
}
2008-10-23 16:46