Search code examples
oopvala

is it possible to call void as a string?


have been searching around for this but it's a little hard to describe so i'll just ask in here. Is it possible to call void as a string?

I think an example would describe it better:

//list of voids in the other class
string[] voids = {"expand()", "show()", "yolo()"};

anotherclass class = new anotherclass();

//call to the void named expand inside the other class
class.voids[0]; //??????

Solution

  • Why use string array, use function pointer array!

    Two good links:

    link1 link2