I won't post all my code, as it is repetetive and long, but here is the class definition my question concerns:
The program creates a 10x10 grid of X's, O's, and I's, and displays them. Then it is supposed to advance the "time", and certain rules are supposed to change the "field". (a basic cellular automation system).Code:class cellField { public: void generateField(char[10][10]); // randomly generates the starting field void generateField(); void advanceTime(); // advances the time and applies cell rules void advanceTime(char [10][10]); void displayField(char[10][10]); void displayField(); private: char fieldArray[10][10]; char tempField[10][10]; };
I won't explain the whole thing, but generateField and displayField and advanceTime need to accept a reference to a 10x10 character array. But if I put "void advanceTime(char &[10][10];", it says that the function is being implemented twice. But they have different inputs, so why is that happening? Can I not do this, or do I need to do it another way?
Here is the code in case anyone needs to look at it:
http://dydx.no-ip.com:8080/cellauto.cpp
(there may be a couple parts of it that seem "broken", but thats probably just because I stopped while trying to fix it and said "BLAH!" and came here)
And yea, the program is sort of useless, but I like doing little "excercises" like this to give myself practice.
Anyways, help!
Thanks!