Self referencing function prototype typedef

F

Fatz

Hello,

Couldn't find reference to this - apologies if that's cuz attempting
it is the mark of an ignominous numpty.

typedef int (FN_t)(char *, FN_t **);

I'm on VMS doing this, tho that shouldn't matter I spose. Here's the
error I get:

.............................^
%CC-E-TYPNOTFOUND, In this declaration, no typedef with the name
"FN_t" occurs in any accessible scope.
at line number 1 in file $1$DGA1:[DENNIS.DEV]FNARG.C;1

I've got a recursive function with a callout function as a parameter,
depending on the flow, the callout function needs to be changed for
the inner call. Do I really have to have 2 function pointers as
arguments to pull this off?

If I do something like this:

typedef int (*FN_1t)(char *, void *);
typedef int (*FN_t)(char *, FN_1t **);

it'll work I spose but it's kinda ugly.


Thanks for any help...

Fatz.
 
E

Eric Sosman

Fatz wrote On 07/18/07 11:21,:
Hello,

Couldn't find reference to this - apologies if that's cuz attempting
it is the mark of an ignominous numpty.

typedef int (FN_t)(char *, FN_t **);

I'm on VMS doing this, tho that shouldn't matter I spose. Here's the
error I get:

............................^
%CC-E-TYPNOTFOUND, In this declaration, no typedef with the name
"FN_t" occurs in any accessible scope.
at line number 1 in file $1$DGA1:[DENNIS.DEV]FNARG.C;1

I've got a recursive function with a callout function as a parameter,
depending on the flow, the callout function needs to be changed for
the inner call. Do I really have to have 2 function pointers as
arguments to pull this off?

If I do something like this:

typedef int (*FN_1t)(char *, void *);
typedef int (*FN_t)(char *, FN_1t **);

it'll work I spose but it's kinda ugly.

See Question 1.22 in the comp.lang.c Frequently
Asked Questions (FAQ) list, <http://www.c-faq.com/>.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top