void function可以单独作为一个表达式,而不可以出现在表达式中
而value-returning function却与之相反
#include <iostream>
using namespace std;
void PlayerType()
{
cout<<"What do you think of?"<<endl;
}
int PlayerPrice(int price)
{
return price*2;
}
int main()
{
PlayerType();
//cout<<PlayerType()<<endl; 注释掉的为不规范操作
//PlayerPrice(2);
cout<<PlayerPrice(2)<<endl;
return 0;
}