Hey guys I'm trying to initialize a 2D char array but am having trouble.
int size = 300 * 400;
char * frame[3] = malloc(sizeof(char *)*size*3);
Gives m: error: invalid initializer.
So I tried:
int size = 300 * 400;
char frame[3][size] = malloc(sizeof(char *)*size*3);
But then I get error: variable-sized object may not be initialized?
Any ideas how I can initialize an array of size 300*400 with 3 rows?
Thanks.