下面这种写法报错: error: 'SayHello' was not declared in this scope
#include <iostream>
using namespace std;
int main() {
SayHello();
return 0;
}
void SayHello(){
cout<<"Hello!"<<endl;
}
下面这种写法成功编译:
#include <iostream>
using namespace std;
void SayHello(){
cout<<"Hello!"<<endl;
}
int main() {
SayHello();
return 0;
}