开发者

Initialise aggregate with include directive

Very quick question. I want to copy & paste textual data into the source code 开发者_运维知识库from the separate file using include directive.

Is it legal?

struct Record; // collection of data fields

Record rec = { #include "some_big_record.txt" };

int numbers[] = { #include "some_long_sequence_of_numbers.txt" };

It works on my box (GCC), but is it portable?


This is portable:

Record rec = { 
#include "some_big_record.txt" 
};
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜