源程序是老师上课给的
#include<stdio.h>
#include
using namespace std;
void sub(char b[]);
main()
{
char a[10]="hello";
sub(a);
cout<<a<<endl;
}
void sub(char b[])
{
b[]="world";
}
供参考:
#include <stdio.h>
#include <iostream>
using namespace std;
void sub(char b[]);
int main()
{
char a[10]="hello";
sub(a);
cout<<a<<endl;
return 0;
}
void sub(char b[])
{
cout<<b<<endl;
}