Earlier quoted context omitted.
Indeed, this is what many people do. But even if you use dynamic memory, if you replace pointer arithmetic by array indexing, you get bounds checking. And in C this also works for arrays of run-time length.
But can't I put any pointer arithmetic in array brackets, so it wouldn't limit anything?
Re: Should I choose Ada, SPARK, or Rust over C/C++? (2024)
#171Whatever index you compute can be checked against a bound.