assert (get_param_types("void func(int, char*, float**)") == ["int", "pointer", "pointer"]) assert (get_param_types("int f(int()(int, char**), float*)") == ["function", "pointer"]) assert (get_param_types("void g(void()(int, double), char*, int)") == ["function", "pointer", "int"]) assert (get_param_types("double h(int**, float()(char), void()(void))") == ["pointer", "function", "function"])

编写一段代码从输入的描述C语言函数原型的字符串中获取函数的参数类型其中如果参数为函数标记参数类型为function如果是指针标记为pointer;需通过以下测试用例:assert get_param_typesint foochar int == pointer intassert get_param_typesvoid barint float double == pointer float d

原文地址: https://www.cveoy.top/t/topic/dbqp 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录