How can I perform pre-main initialization in C/C++ with avr-gcc?

后端 未结 9 1965
名媛妹妹
名媛妹妹 2020-12-28 09:21

In order to ensure that some initialization code runs before main (using Arduino/avr-gcc) I have code such as the following:

class Init {
public         


        
9条回答
  •  一生所求
    2020-12-28 09:57

    Your solution in simple and clean. What you can additionally do is to put your code in anonymous namespace. I don't see any need to make it better than that :)

提交回复
热议问题