How to auto-include all headers in directory

前端 未结 10 3270
被撕碎了的回忆
被撕碎了的回忆 2021-02-20 12:32

I\'m going through exercises of a C++ book. For each exercise I want to minimize the boilerplate code I have to write. I\'ve set up my project a certain way but it doesn\'t seem

10条回答
  •  长发绾君心
    2021-02-20 13:03

    try this:-

    #ifndef a_h
    #define a_h
    
    #include 
    #include 
    #incl....as many u like
    class a{
    f1();//leave it blank
    int d;
    }
    #endif //save this as a.h
    

    later include this in ur main program that is cpp file

    #include "a.h"
    

    ...your program

提交回复
热议问题