Date: Tue, 22 Jul 1997 08:00:26 -0700 (PDT) Message-Id: <199707221500.IAA26331@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: NoHero69 AT aol DOT com From: Nate Eldredge Subject: Re: Calling functions indirectly (was: ...) Cc: djgpp AT delorie DOT com Precedence: bulk You wrote: >One quick question. If I have a pointer that points a function, what is the >syntax of calling the procedure via the pointer? Is it a simple CALL > in ASM, Yes. Be sure to push its args first, and adjust the stack afterwards. > and is there a way to do it outside the bounds of ASM? Yes. int do_something(void) { printf("Hello there\n"); return 0; } int call_this_function(int (*f)(void)) { int r; r = f(); printf("Function returned %d\n",r); return 0; } void top_level(void) { call_this_function(do_something); } HTH Nate Eldredge eldredge AT ap DOT net