C
cerr
Hi There,
I'm trying to create a two dimensional array to store a collection of artist & song names.
I've tried this:
#include <stdio.h>
#include <stdlib.h>
int main(void){
char *test;
test = (char*) malloc(1);
test[0] = (char*) malloc(50);
test[0] = "artist";
test[0][0] = "song";
return 0;
}
but get error: subscripted value is neither array nor pointer nor vector
why is this?
Thanks
I'm trying to create a two dimensional array to store a collection of artist & song names.
I've tried this:
#include <stdio.h>
#include <stdlib.h>
int main(void){
char *test;
test = (char*) malloc(1);
test[0] = (char*) malloc(50);
test[0] = "artist";
test[0][0] = "song";
return 0;
}
but get error: subscripted value is neither array nor pointer nor vector
why is this?
Thanks