简体   繁体   中英

Can I configure my Dev C++ or any other C++ compatible IDE to automatically include some code in every new source file that I create?

I have been working on Dev c++ for a while, and often most of the source files I create ,generally include same header file declarations, #define directives and even some of the variables declarations. So is there a way to include all of this code for each new source file that I create, so that manual copying and pasting job is minimized

In eclipse you can edit Templates

在此处输入图片说明

Link

Dev-C++ I believe has GCC/MinGW underneath

Thus, you put all your common defs, ..., into one include file (lets call it config.h) and pass down GCC option -include

-include file

Process file as if "#include "file"" appeared as the first line of the primary source file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM