Then we need to set `(*npv) = i + 1;` inside the loop and `(*npv) = i;` outside it at the end.