Computer Chess Club Archives


Search

Terms

Messages

Subject: Pointer to C++ function (OT)

Author: Peter Fendrich

Date: 07:01:54 03/23/01


I probably should know this - kind of embarrassing....

In C I sometimes used this kind of construction:
  int intParm; char strParm[100];
  void (* FP)(char *, int *);
  .
  .
  .
  FP = (void ( *)(char *, int *)) &Function; // cast to function pointer
  (*FP)(strParm, &intParm);                  // call the function


In C++ I can't manage to do this.
Anyone knows how to use a pointer to a function in a class in C++?

//Peter



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.