Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在浏览队列示例时,我遇到了
http://login2win.blogspot.in/2008/07/c-queues.html
它是一个队列示例,其中索引从 -1 开始,但程序似乎运行良好
这是否有效,在某些情况下这不应该是未定义的行为吗?
你是对的。此代码无效,因为它正在取消引用该数组之外的内存。