动态声明变量/结构用C [英] Dynamically declare variables/structure in C

查看:84
本文介绍了动态声明变量/结构用C的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我有一个文件,该文件说:

For example, I have a file, which says

char,5
int,6

看完上面的文件,是否有可能宣布在code 2变量数组?因此,在未来的
如果我添加一个新行会自动申报?

Reading the above file, is it possible to declare 2 variable array in the code? So in future if i add a new line it will automatically declare?

推荐答案

没有,没有结果C.
您将需要编写一个脚本,它读取这个文件,并写入C程序。结果
总之,你需要的是一个 C源代码code发电机

No, not in C.
You will need to write a script which reads this file and writes the c program.
In short, what you need is a C Source Code Generator.

这篇关于动态声明变量/结构用C的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆