function pointer help needed (again)

Bob Stout Bob.Stout at p6.f506.n106.z1.fidonet.org
Thu Jul 20 17:30:49 AEST 1989


In an article of <18 Jul 89 01:19:58 GMT>, (Bob Calbridge) writes:

 >Here's the problem.  I'm attempting to use the windowing functions of a 
 >library called CXL to design a utility program. 

Excellent choice...

 >Now, here's a piece from my program:
 >
 >wmenubeg (27,9,53,20,5,0,_BLUE|WHITE,NULL);
 >      wmenuitem (1,2,"Build a configuration",'B',1,0,build_config(),0,0);
 >      ...

Assuming that build_config() and your other functions are properly declared  
and/or prototyped, this is almost right. Leave off the "()" when including the  
function in the call to wmenuitem(). The way you have this written, what's  
being passed to wmenuitem() is the return value from calling build_config()  
with no arguments. Simply sayding (...,build_config,...) will put the address  
of the build_config() function into the parameter list for wmsnuitem() - but  
only, as I mentioned, if it's been previously declared. 



More information about the Comp.lang.c mailing list