variable name, function arguments at run time in C

前端 未结 4 1864
青春惊慌失措
青春惊慌失措 2021-01-12 15:07

Is it possible to know a function arguments and variables\' name types at runtime in C program ? For example, if I have a function:

int abc(int x, float y ,          


        
4条回答
  •  鱼传尺愫
    2021-01-12 15:43

    There isn't really a native way to do this in C. In other languages, what you'd be looking for would be reflection. You can cheese it with macros and some tricks, but on a basic principle, you need to know variable names and arguments at compile time.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题