Suppose v is an array with 100 int elements. If 100 is assigned to v[100], what happens?

LANGUAGE: C++

CHALLENGE:

Suppose v is an array with 100 int elements. If 100 is assigned to v[100], what happens?

SOLUTION:

The Bad News: The content you are trying to access is only available to members.

The Good News: You too can be a member, simply Click Here.

Already a member?

Posted in ,

2 Comments

  1. anonymous on November 8, 2014 at 8:18 pm

    that is not the right answer, the right answer is,

    An exception will be thrown when that statement is executed.

    • Horton on April 15, 2017 at 2:43 pm

      Above comment is incorrect. The correct answer is the one currently stated.

      Another variable or array will very likely be unexpectedly modified.

Leave a Comment

You must be logged in to post a comment.