2 ms·
Do "references" even exist in C? Aren't they a C++ thing? How do you manage heap allocations without ever touching a pointer?
by LoganDark 3y ago
Do "references" even exist in C? Aren't they a C++ thing?
How do you manage heap allocations without ever touching a pointer?
- munk-a 3y agoEdited for correctness - I was indeed talking about C++ and references are relevant only in C++. C absolutely has stack allocations which can make things a fair bit safer but if you're passing around collections it's usually done by pointer just to avoid copy actions.
- LoganDark 3y agoC has VLA, but I think C++ can still use alloca, although that returns a pointer still.