Q:

What would happen if the while loop on page 148 that prints the elements from a vector used the prefix increment operator

0

What would happen if the while loop on page 148 that prints the elements from a vector used the prefix increment operator?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

The loop will print all elements except the first one in the vector, and also try to dereference to one past the last element, which is an error. Also, if there is no negative value in the vector, the loop will continue to dereference whatever in memeory until a negative value is found, which is a disaster.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now