#include
using namespace std;
void sub(char b[])
{
b[0]={'w','o','r','l','d'};
}
int main(void)
{
char a[10]={'h','e','l','l','o'};
sub(a);
cout<<a<<endl;
return 0;
}
这个怎么改才能运行!
#include <iostream>
#include <string>
using namespace std;
void sub(char b[])
{
strcpy(b,"world");
}
int main(void)
{
char a[10]={'h','e','l','l','o'};
sub(a);
cout<<a<<endl;
return 0;
}
b[0]是一个字符