What happens if an invalid index value is passed to a function?

Skill/Topic: Stacks and Queues: Insert, Delete, Peek, Find
A) If an invalid index is passed, the function terminates without further processing. [Explanation] Functions that use an index value always determine if the index passed to them is valid before using the index value . If an invalid index is received, the

Showing Answers 1 - 1 of 1 Answers

If the user passes in an invalid index, the program will cause an assertion error. While this is useful to indicate to the user that something went wrong, so they can deal with it as appropriate.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions