You can improve this by making Dummy a static, this will reduce the overhead of the overall usage. 👍🏻 . That’s for the great tutorial.
@thehelloworldguyofficial
3 ай бұрын
That would be awesome, but unfortunately, that is not possible, because "static" variables are a C++ thing. C doesn't have those :-(
@petersuvara
3 ай бұрын
@@thehelloworldguyofficial indeed. I think it’s only static for outside structures.
@thehelloworldguyofficial
3 ай бұрын
@petersuvara yes, you are correct.
@petersuvara
3 ай бұрын
@@thehelloworldguyofficial I wonder if setting it as const optimises is the size somehow. Would be interesting to see.
@thehelloworldguyofficial
3 ай бұрын
@petersuvara Well, setting it as const will still reserve the same amount of memory. So, it should not really optimize the size. For most stuff, the memory waste isn't that significant. A few extra bytes doesn't really hurt. :-)
Пікірлер: 8