4 ms·
I think one of the author's problems is that he conflates C and C++ and it seems they do not have a knowledge around either. This quote also supports this: > T
by hawski 4y ago
I think one of the author's problems is that he conflates C and C++ and it seems they do not have a knowledge around either. This quote also supports this:
> There is no malloc keyword like in C/C++.
- T-A 4y agoAre you nitpicking about it being a keyword in C, https://en.cppreference.com/w/c/memory/malloc https://en.cppreference.com/w/c/memory/malloc and a standard library function in C++ https://en.cppreference.com/w/cpp/memory/c/malloc https://en.cppreference.com/w/cpp/memory/c/malloc ?
- tialaramex 4y agoThat's not a keyword. It's just a free function, maybe you could argue it is an intrinsic since it's magic and needs to some extent to be blessed by the implementation (It is conjuring things from "nowhere" in the higher level language, obviously normal functions aren't supposed to just make objects, only transform them - but this can, so that's magic)
- T-A 4y agoAh yes, you're right, it's not strictly speaking a keyword in either one.
- hawski 4y agoIt is not a keyword in C, so it is not a nit. For all the language is concerned it is just a function that takes a number and returns a pointer. If a compiler treats it any different it is only a question of optimizations or to generate helpful warning/error messages. You can point linker to a different implementation for all it cares.