Chilton 22 Junior Poster

You only set mid once, and that was outside of any loop, so it doesn't update when last or first changes.

Chilton 22 Junior Poster

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.

Chilton 22 Junior Poster

The point wasn't to do the program for the person asking, though.

Nick Evan commented: True +16
Chilton 22 Junior Poster

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.

Chilton 22 Junior Poster

Work on understanding variables and proper syntax before beginning the assignment. Also, to the poster above, please don't provide answers only suggestions.

Chilton 22 Junior Poster

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.

Chilton 22 Junior Poster

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.

Chilton 22 Junior Poster

And here I thought the point wasn't to simply give the answer.

Aia commented: Yes, it is. +6
Chilton 22 Junior Poster

I'd suggest buying it.