4 ms·
It is an abstraction, but the safety requirements are neither enforced nor abstracted away. C's type system can't communicate how long pointers are valid for,
by pornel 2y ago
It is an abstraction, but the safety requirements are neither enforced nor abstracted away.
C's type system can't communicate how long pointers are valid for, when and where memory gets freed, when the data may be uninitialized, what are the thread-safety requirements, etc. The programmer needs to know these things, and manually ensure the correct usage.