Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Oop 是否可以将void作为字符串调用?_Oop_Vala - Fatal编程技术网

Oop 是否可以将void作为字符串调用?

Oop 是否可以将void作为字符串调用?,oop,vala,Oop,Vala,我一直在寻找这个,但它有点难以描述,所以我只想在这里问一下。是否可以将void作为字符串调用 我认为一个例子可以更好地描述它: //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 cl

我一直在寻找这个,但它有点难以描述,所以我只想在这里问一下。是否可以将void作为字符串调用

我认为一个例子可以更好地描述它:

//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]; //??????

为什么使用字符串数组,使用函数指针数组

两个好链接:


即使vala支持指针,这似乎也不起作用。您能展示一个使用vala语言的示例吗?在vala中称为
delegate