Preventing multiple #define when including headers

后端 未结 3 966
暖寄归人
暖寄归人 2021-01-27 08:07

coming from python and am a bit tripped up on what the proper approach to this is.

I am trying to include this library in my project: https://github.com/nothings/stb/blob

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-27 08:49

    #define is a preprocessor directive and doesn't actually get run everytime the header is accessed so you should 't have any problems

    if you are using visual studio you can also do #pragma once to only parse the file once stopping anything from happening twice

提交回复
热议问题