Lewissi
22/09/2005, 21:11
#include<iostream>
#include<cstring>
using namespace std;
using std::string;
class Dice{
private:
int val;
public:
Dice(int in=0)
{
val=in;
}
~Dice(){
}
void roll(){
val=rand();
cout<<val<<endl;
}
};
int main()
{
// zar sinifini argumansiz cagirinca
// request for member `roll' in `zar', which is of non-aggregate type
//`Dice ()()'
// diye hata veriyor. bu ne demek?
Dice zar();
zar.roll();
return 0;
}
#include<cstring>
using namespace std;
using std::string;
class Dice{
private:
int val;
public:
Dice(int in=0)
{
val=in;
}
~Dice(){
}
void roll(){
val=rand();
cout<<val<<endl;
}
};
int main()
{
// zar sinifini argumansiz cagirinca
// request for member `roll' in `zar', which is of non-aggregate type
//`Dice ()()'
// diye hata veriyor. bu ne demek?
Dice zar();
zar.roll();
return 0;
}