编译错误!
#include "iostream.h"#include "stdlib.h"
#include "math.h"
void star(int a);
int main()
{
int n;
cout<<"请输入星号的个数:";
cin>>n;
cout<<star(n)<<endl;
return 0;
}
void star(int a)
{
for(int i=0;i<a;i++)
{
cout<<'*';
}
}
error C2679: binary '<<' :no operator defined which takes a right-hand operand of type 'void' (or there is no acceptable conversion)
#include "stdlib.h"不是已经调用void了?