在 C 语言中,如果下标超出数组的大小时,给数组赋值时会发生什么情况?
在其他语言中它抛出异常,C也抛出异常吗?出于某种原因,我没有收到任何错误
最佳答案
What happens when assign a value to an array if the subscript exceeds the size of the array in C?
坏事发生了。或不。事实上,标准规定它是未定义的行为,这意味着任何事情都可能发生。
In other languages it throws an exception, does C also throw an exception?
没有。
关于c - 如果下标超过 C 中数组的大小时,为数组赋值时会发生什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2108476/