2 ms·
Multiple variables shouldn't be scary. Storing the same data multiple times is... You just need to use pointers. See https://github.com/alexchamberlain/byte-ord
by alexchamberlain 15y ago
Multiple variables shouldn't be scary. Storing the same data multiple times is... You just need to use pointers. See https://github.com/alexchamberlain/byte-order https://github.com/alexchamberlain/byte-order.
- coffeeaddicted 15y agoYou realize your code is littered with just those defines which the article wrote are not necessary at all? You are exactly proving my point, you don't need a second variable in the case where you don't need to switch bytes when you use a define. And the trick is to use the define only after you already have the value already in the integer. In his solution you would need the data pointer which you have put into the define _always_.
- alexchamberlain 15y agoThey are necessary to provide optimal code without relying on the optimiser.