Re: typedef with function pointers



On Sep 30, 1:52 pm, Tor Rustad <tor_rus...@xxxxxxxxxxx> wrote:
Googy wrote:
Hi!!
Can any one explain me the meaning of following notations clearly :

1. typedef char(*(*frpapfrc())[])();
frpapfrc f;

2. typedef int (*(arr2d_ptr)())[3][4];
arr2d_ptr p;

3. typedef int (*(*(*ptr2d_fptr)())[10])();
ptr2d_fptr q;

4. typedef char (*(*arr_fptr[3])())[10];
arr_fptr x;

5. typedef float *(*(*(*ptr_fptr)())[10])();
ptr_fptr y;

What are f,p,q,x,y?? and how?
Please don't just answer what they are explain then clearly..

homework-o-meter = 100%

Hint: cdecl

Heres are quick question:

A typical typedef for a data type like a struct goes like:

typedef struct X { ...} XStruct;

where XStruct is now "struct X". Why don't we follow a similar way to
define function pointers? Or is it that the placement of the type
defined follows a similar rule for both these declarations?

-Vardhan



--
Tor <torust [at] online [dot] no>
"To this day, many C programmers believe that 'strong typing' just means
pounding extra hard on the keyboard"


.



Relevant Pages

  • Re: How can I obtain 2 and 4-byte data types?
    ... > Yesterday I found a portability issue I can't seem to get around and ... all my code falls to pieces if there is no data type ... > and still write it in big and little endian?? ... insert padding bytes after any element of a struct (including ...
    (comp.unix.programmer)
  • Re: Using VBA, can I format data so a web server will regard the data as a struct?
    ... The programmers behind this website have set up five methods that I ... The first method returns a website sessionID. ... The household data is supposed to be a "struct" data type. ...
    (microsoft.public.access.modulesdaovba)
  • Using VBA, can I format data so a web server will regard the data as a struct?
    ... The programmers behind this website have set up five methods that I ... The first method returns a website sessionID. ... The household data is supposed to be a "struct" data type. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Using VBA, can I format data so a web server will regard the data as a struct?
    ... The programmers behind this website have set up five methods that I ... The first method returns a website sessionID. ... The household data is supposed to be a "struct" data type. ...
    (microsoft.public.access.modulesdaovba)
  • Re: nested loop use example
    ... any data type. ... struct Double_Link_Node ... C++ Faq: http://www.parashift.com/c++-faq-lite C Faq: http://www.eskimo.com/~scs/c-faq/top.html alt.comp.lang.learn.c-c++ faq: ... Other sites: http://www.josuttis.com -- C++ STL Library book http://www.sgi.com/tech/stl -- Standard Template Library ...
    (comp.lang.cpp)