3 ms·
Also the Rational usage example in C++ is using stack allocation. It's weird to then pretend like heap allocation is equivalent in the C example. I think making
by rezonant 3y ago
Also the Rational usage example in C++ is using stack allocation. It's weird to then pretend like heap allocation is equivalent in the C example. I think making stack allocation work in this case would probably be difficult, but it's worth pointing out in the article that the choice is intentional and not a misunderstanding of non-new allocation in c++.
You could just use new() in the first example instead and avoid the whole issue.