Hey everyone,
Browsed through the forums and a C++ book, but can't find what I'm doing wrong.
1)Goal is to pass colors array to a function that picks a color set from 19 options and modifies red, green, and blue to be used in an allegro function. Each color set can only be picked once.
2) Error occurs when I try and call pickColor() in main, compiler says: expected primary expression before ']' token
Other notes: Array is hard-coded in main (omitted for space reasons) pickColor function doesn't use for loops, so passing array size was unnecessary (actual function contents omitted for space). I'm using Dev-C++ 4.9.9.2, Allegro function library is installed, but no allegro functions are used here.
Thanks!
#include <cstdlib>
#include <iostream>
#include <ctime>
using namespace std;
void pickColor(int types[][19], int &red, int &green, int &blue) {
}
int main(int argc, char *argv[])
{
int red = 0, green = 0, blue = 0;
int colors[4][19];
pickColor(colors[][19], &red, &green, &blue);
system("PAUSE");
return EXIT_SUCCESS;
}