I am making a program that will allow me to randomly generate coordinates for the locations of "Gravitars". I havent even implemented the Get or Set functions of the class Gravitar yet, so don't worry about those. I am simply trying to get a 3 dimensional array of random numbers in the for loop at the end of the program, but I am getting problems on the line where I declare "triarray" and on the lines inside the for loop. The error inside the for loop states: "Gravitar" does not define this operator or a conversion to a type acceptable to the predefined operator"
I'm teaching myself C++ so that I can write this program as a project this summer, and any help towards fixing these errors and some pointers would be much appreciated!
class Gravitar //creates a class called Gravitar
{
public:
//public accessors
double GetRadius();
void SetRadius(double radius);
double GetAngle();
void SetAngle(double angle);
double GetZed();
void SetZed(double zed);
private:
double Radius;
double Angle;
double Zed;
};
int main()
{
//double normalization = rand() % 32000;
seed();
int m ;
cout << "How many Gravitars?\n\n";
cin >> m;
//intializes the 3 dimensional array as a pointer of type double.
Gravitar* triarray = new Gravitar[m][m][m]; // then use 'new' to allocate an array of m doubles
for (int i = 0; i < m; i++)
{
triarray[i][i][i] = unifRand();//*(normalization);
cout << triarray[i][i][i] << endl;
}
system("PAUSE");
return 0;
}