You only set mid once, and that was outside of any loop, so it doesn't update when last or first changes.
You only set mid once, and that was outside of any loop, so it doesn't update when last or first changes.
You have to set c to 0, because it needs to increment until it counts the amount of characters in cols. When it reaches that amount, then you've finished printing one line.
As for c += greeting.size();, c is incremented by the amount of the "greeting" since in the previous statement, cout << greeting;, you've printed out greeting.size() characters.
The point wasn't to do the program for the person asking, though.
If you're trying to pass the array to the function, you should just pass the name of the array "levelOnePlatform" as the first argument and 50, as the second argument which is its size.
Work on understanding variables and proper syntax before beginning the assignment. Also, to the poster above, please don't provide answers only suggestions.
One thing to note is that accumulate's third parameter, 0 in this case, makes your result an integer because the function takes that type as its value. Therefore, the fractional part of your code would be disregarded.
Change the 0 to 0.0.
Using static_cast isn't really an advanced way. I mean, if you want the simplest then following the advice to simply assign it to an integer variable should suffice.
You can always add a comment explaining what it does, just to make your intentions clear.
And here I thought the point wasn't to simply give the answer.