4 ms·
Hey , first time posting something I've made here I think :D. I'm excited to hear what you think about it!
by D4ckard 3y ago
Hey , first time posting something I've made here I think :D. I'm excited to hear what you think about it!
- lmz 3y agoI'd suggest removing the part where you use malloc to allocate and just skip to the part where you use new and link to libstdc++. At the malloc part I was wondering what the point of the whole thing was when you're basically using none of the C++ logic and rewriting everything in C.
- rezonant 3y agoAlso 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.