What should the prototype for a function that returns a pointer to an array?

I declared this: char (* words)[13];
Now I need to declare a function that returns the variable: words.
If I declare like this: char (*)[13]GetWords();
the compiling error is: "abstract declarator `char (*)[13]' used as declaration ".
If I declare like this: char *[13]GetWords();
then the compiling error is: "abstract declarator `char*' used as declaration".

Can any one tell me the correct way to do this? Thank you in advance.
I believe this is what you wanted to achieve:

1
2
3
4
typedef int arr[12];
typedef arr *(*fp_t)();
arr *f() {}
fp_t fp = &f;
Remember, typedef is your friend.
1
2
3
typedef char word_t[13];
word_t* words;
word_t* GetWords();
Cool! Thank you R0mai and kbw.
:-D
Topic archived. No new replies allowed.