非常快的问题。我想使用 include 指令将文本数据从单独的文件复制并粘贴到源代码中。
合法吗?
struct Record; // collection of data fields
Record rec = { #include "some_big_record.txt" };
int numbers[] = { #include "some_long_sequence_of_numbers.txt" };
它可以在我的盒子 (GCC) 上运行,但它是否便携?
最佳答案
这是可移植的:
Record rec = {
#include "some_big_record.txt"
};
关于c - 使用 include 指令初始化聚合,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5737497/