include all files in a directory?

前端 未结 4 1928
别跟我提以往
别跟我提以往 2020-12-09 15:30

How can one achieve what the following code is trying to do?

#include \"dir/*\"
4条回答
  •  不知归路
    2020-12-09 16:22

    You can't, without running a script beforehand that generates all #include statements.

    The preprocessor can only handle one file per #include statement, so it requires an actual #include for every single file you wish to be included in preprocessing.

提交回复
热议问题