How does C handle array indices that are out of bounds?

  • C dynamically resizes the array
  • C ignores out-of-bounds indices
  • C throws a runtime error
  • C wraps around to the beginning of the array
In C, when array indices are out of bounds, the behavior is undefined. C does not perform any bounds checking, and it's the programmer's responsibility to ensure indices are within bounds to avoid unexpected results.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *