Q:

Assuming arr is an array that holds int values, we might find the first negative value in arr as follows

0

Assuming arr is an array that holds int values, we might find the first negative value in arr as follows.

All Answers

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

// pbeg points to the first and pend points just past the last element in arr
int *pbeg = begin(arr), *pend = end(arr);
// find the first negative element, stopping if we've seen all the elements
while (pbeg != pend && *pbeg >= 0)
++pbeg;

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