This is wrong:
Code:
char **test = calloc(3,sizeof(char));
You probably wanted to allocate space for 3 pointers to char, so it should have been:
Code:
char **test = calloc(3, sizeof(char*));
but you can avoid such mistakes to begin with by writing:
Code:
char **test = calloc(3, sizeof(*test));
This is wrong:
Code:
for(a=0;a<3;a++){
free(test[a]);
}
You did not use malloc/calloc to allocate, so you should not use free.
Oh, and this is not good practice:
"Test" will be converted to a const char*, hence you are assigning a const char* to a char*. This risks modifying the string literal through the pointer to non-const char, resulting in undefined behaviour.
Also, where are your header inclusions?
Oh, and another thing: why are you incrementing the char* instead of the char** when you want to traverse to the next char*?
Besides this, main should be explicitly declared as returning an int.