How to use (pointer to function), and function and pointer to (pointer to function) 
Author Message
 How to use (pointer to function), and function and pointer to (pointer to function)

I have seen a topic in my C book. Below is the content.
int *hello(int, int);

int (* hello)(int, int);

int *(* hello)(int, int);
Can anyone help me to write six function to explain the above, three for
return value and three for (void).
Thanks a lot!



Tue, 24 Dec 2002 03:00:00 GMT  
 How to use (pointer to function), and function and pointer to (pointer to function)

Quote:

> int *hello(int, int);
> int (* hello)(int, int);
> int *(* hello)(int, int);
> Can anyone help me to write six function to explain the above, three for
> return value and three for (void).

first of all, your request doesn't make sense, but even if it did, no, we do
not do your homework for you.

FYI:

cdecl> explain int *hello(int, int);
declare hello as function (int, int) returning pointer to int
cdecl> explain int (* hello)(int, int);
declare hello as pointer to function (int, int) returning int
cdecl> explain int *(* hello)(int, int);
declare hello as pointer to function (int, int) returning pointer to int

--
             /"\                                m i k e    b u r r e l l

              X        AGAINST HTML MAIL,
             / \      AND NEWS TOO, dammit



Tue, 24 Dec 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Pointer Functions and Pointers to Pointer Functions

2. Question about signal()/pointers to functions that return pointers to functions

3. function pointers and function pointers array

4. C++ function pointers versus C function pointer problem

5. Pointer to function returning pointer to function returning...

6. Dereferencing f-pointers, arrays of f-pointers, pointers to f-pointers

7. Pointers to Structure that contains pointer to Function

8. Casting function pointer to void pointer

9. Pointer to an array of pointers to functions

10. Assigning structure pointer to function pointer

11. pointers to functions and pointers to void.

12. pointers to functions in structs which take a pointer to that struct as an arg

 

 
Powered by phpBB® Forum Software