Re: what is this declaration?



1230987za@xxxxxxxxx wrote:
Hi,

I was reading a post about how to learn C programming and someone
mentioned this, *(int f()) in a struct. It is not in any C code, I
guess the guy was showing that there are some tricky part in C.

It does look tricky to me, what does it mean?

Is the following correct?

f is a function; the function returns an integer; this integer is de-
referenced just like a function pointer.

Can someone show me an example usage of such declaration?

It needs more context.
What you've shown is neither a declaration nor an expression
nor any other C construct that I'm familiar with.

--
pete
.



Relevant Pages

  • Re: syntax errror
    ... >>> int maxGrey' ... >> declaration of maxGrey. ... typedef double; ... struct some_tag_name { ...
    (comp.lang.c)
  • Re: void * vs char *
    ... cast p to a (struct s*) to avoid a compile-time error. ... struct s {int a;}; ... function call consists solely of an identifier, and if no declaration ... And see what your compiler has to say. ...
    (comp.lang.c)
  • Re: formal parameter 1 different from declaration?
    ... Here is the typedef one: ... typedef LR (HWND, long, int, int); ... struct tagWnd; // forward declaration ... takes a struct tagHwnd and the other takes a long. ...
    (microsoft.public.vc.language)
  • Re: Passing Structure to a function
    ... > int Menu; ... 'struct' keyword above is because otherwise you got compiler errors. ... The reason for the errors is that phonerec hasn't been declared or ... A structure declaration merely says that a structure ...
    (comp.lang.cpp)
  • Re: A clarification please
    ... "A struct declaration defines a type. ... int x, y, z; ... when talking about the preprocessor, language syntax, or the use of ...
    (comp.lang.c)