Hello, I'm having some trouble with filling an array in my code I'm suppose to write a function that fills an array that looks like this void fillArray(int ar[], int size, int inc);
The function assumes the 0th element, ar[0] is already filled with some value, and fills the remaining slots, from ar[1] on, with the value of the preceding element plus 'inc'. For instance, when ar[0] was filled with 5, ar[1] should be 8, ar[2] should be 11 and so on.
I have written most of the code but this part for some reason is throwing me off, which honestly at first did not seem so difficult but i have tried everything to and still nothing. if anyone can help me with this fucntion, I would greatly appreciate it. Thank You.
I started with a for loop something like this for (int i = 0; i < size; i++)
after that i tried something like ar[i] + inc. again im kind of new to c++, so i apologize for that. honestly im not too sure what to do after that or if im even on the right track.