---
title: "Hjälp att definiera funktionsprototyp"
type: "forum-thread"
url: "https://www.webforum.nu/amne/c-cpp/181449-hjälp-att-definiera-funktionsprototyp"
topic: "C/C++"
topic_url: "https://www.webforum.nu/amne/c-cpp"
author: "lillebror"
published: "2009-11-29T22:27:40.000Z"
updated: "2009-11-29T22:27:40.000Z"
replies: 0
views: 1025
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/c-cpp/181449-hjälp-att-definiera-funktionsprototyp"
---

# Hjälp att definiera funktionsprototyp

## #1 — lillebror, 2009-11-29T22:27Z

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);
}
```

Permalänk: https://www.webforum.nu/p/181449

---

Tråden på webben: https://www.webforum.nu/amne/c-cpp/181449-hjälp-att-definiera-funktionsprototyp
