Frågan#1
Hej,
Jag har kört fast med hur jag ska definiera funktionsprototypen för funktionerna initGame och showGeneration. Båda funktionerna tar en 2-dimensionell vektor som argument. I funktionsdefinitionen skall det vara en pekare som pekar på vektorn. Hur definierar jag det här så att det blir rätt?
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <iomanip>
#include <conio.h>
using namespace std;
enum Cell {Unoccupied, Occupied};
const int ROWS = 16;
const int COLS = 16; //Max usable size is 15 x 15
const char ESC = 27;
typedef Cell genType[ROWS+1][COLS+1]; //Row 0 and 16 and col 0 and 16 become a frame around the world
void initGame(int *gen[][], int *genNb); //detta är mitt förslag
int main()
{
initGame(gen, genNb);
showGeneration(gen, genNb);
}