Cześć,
potrzebuję zwrócić tablicę wskaźnikową char z zawartymi danymi do funkcji main. Ogólnie jest to część większego projektu ale uprościłem do to takiej formy. Co robię źle?
#include <stdio.h>
#include <stdlib.h>
char **funkcja()
{
char *buffer[] = {"jeden", "dwa", "trzy"};
return buffer;
}
int main()
{
char **buf = funkcja();
printf("%s", buf[1]);
return 0;
}