C Function Parameters

Tyro ridimz at yahoo.com
Tue Sep 5 02:49:56 PDT 2006


Could someone please tell me if I'm reading the following correctly

	int myfunc(MyStruct *ms, void * (*allocF)(size_t s))

The second parameter above [void * (*allocF)(size_t s)], is a pointer to 
a function that accepts a size_t parameter and returns a void pointer? 
If so, I have two questions:

	1) Why is the function  pointed to being dereferenced? Why [(*allocF)] 
instead of [(allocF)]?

	2) Is [void function(size_t s) allocF] a suitable replacement or would 
it be better to use a delegate?

Thanks
-- 
Andrew C. Edwards
-----------------------------------------------------
The truth we call D, has passed through three stages:
   First ridiculed; Then violently opposed;
   And now, it is being accepted as self-evident.
Consequently:
   C/C++ is rapidly approaching Stage 5 (being forgotten)!



More information about the Digitalmars-d-learn mailing list