I am trying to make a program for my controller, and the idea is to have a 3 by 3 grid, each cell would be like |4LetterStringInHere| and provide information. VCS did not allow for classes, but vexcode does. I am trying to declare a class and run into this error [clang] No viable overloaded ‘=’ (fixes availible)
Here is my code
//------------------------------------------------
class Cell{
public:
int column;
int row;
int rowindex;
int index = 0;
int validCycles;
std::string Storage[10];
std::string display;
Cell(int column, int row, int cycles, std::string Messages[cycles]){
this-> column = column;
this-> row = row;
this-> rowindex = 5 * this->row + 1;
for(int i = 0; i > cycles; i++){
this->Storage[i] = Messages[i].erase(4, Messages[i].length() - 1);
}
this-> validCycles = cycles;
this-> display = Storage[0];
}
void validIndex(){
if(this-> index > this-> validCycles - 1){
this-> index -= this-> validCycles;
}
if(this-> index < 0){
this-> index = this-> validCycles - 1;
}
}
void CycleUp(){
this-> index++;
validIndex();
this-> display = this-> Storage[index];
}
void CycleDown(){
this-> index--;
validIndex();
this-> display = this-> Storage[index];
}
void CycleTo(int newIndex){
this-> index = newIndex;
validIndex();
this-> display = this-> Storage[index];
}
};
class ControllerFeed{
public:
int column;
int row;
std::string StorageArray[3] = {"Green", "Orange", "Purple"};
Cell Array[3][3];
ControllerFeed(){
//ERROR HERE
//ERROR HERE
//[clang] No viable overloaded '=' (fixes availible)
Array[0][0] = new Cell(0, 0, 3, StorageArray);
}
};
//-----------------------------------------------------------
This may be more of a general C++ question, but thanks if you can help!