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.

Required fields*

7
  • 2
    There's no out of bounds access or UB in your example. Commented Jun 17, 2015 at 5:53
  • @BlueMoon Wanted to show some array out of bound access and end up writing in-bound access code :) Commented Jun 17, 2015 at 6:00
  • 3
    char a[3] = "string"; isn't a run-time buffer overflow, it's a constraint violation that will be detected at compile time. N1570 6.7.9p2: "No initializer shall attempt to provide a value for an object not contained within the entity being initialized." Commented Jun 17, 2015 at 6:02
  • @KeithThompson yeah I get it Commented Jun 17, 2015 at 6:03
  • @KeithThompson Yeah I made my point clear by showing out of bound access which should be good Commented Jun 17, 2015 at 6:12