2

Is it possible to call a method by its name as string?

#define callmethod(function) \
this->#function();

Just a simple example. (it doesn't work).

callmethod("myfunction");

error: expected unqualified-id before string constant

Aleksandar
  • 3,840
  • 8
  • 27
  • 45
yayuj
  • 1,904
  • 3
  • 15
  • 28

0 Answers0