Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • Which one of the 3 examples did you use? Arrays, linked list or stl? Commented Aug 2, 2012 at 13:57
  • 2
    Oh. Yes, it's UB indeed. Commented Aug 2, 2012 at 13:59
  • 1
    Another line is rear = ++rear % MAX_SIZE; which is also UB. Please don't use that code at all! Commented Aug 2, 2012 at 14:01
  • 1
    I'd advise finding a different tutorial. You apparently already know more than the author... Commented Aug 2, 2012 at 14:21