[Homework] Could I get some help with this?

I'm not quite sure how to go on from here. This is what I have so far.
Here is the question : http://i.imgur.com/qJlJpjg.png
Last edited on
Each of these functions requires you to iterate over a buffer and do something to each cell of the buffer. The most straightforward way to approach this is to use a for-loop (http://www.cplusplus.com/doc/tutorial/control/#for).

1
2
3
4
5
for (int i = 0; i < bufferSize; i++)
{
    // do something to buffer[i]
    buffer[i] = 0;
}


This particular example sets each item in buffer to 0 (i.e. "zeroes" the buffer). You will want to do other things to each cell of a buffer depending on which function you're writing, but in each case you will use a for-loop to traverse one cell at a time.
I created those functions, i'm just not sure what to put in them :\
You don't know how to get started?
Topic archived. No new replies allowed.