I have some problems understanding how to solve my homework.
After about 6h of experimenting I thought to get some help.
The Task:
I have to give out an included one-dimensional char array via the console.
However I
have to use (2) pointers.
The linewidth of each line has to be 50 characters.
The problem:
While the task itself is not very complicated I don't know how to use the 2 pointers given in a useful way.
The pointers are declared as char *line and char *letter.
I use *letter[i] to get the symbols from the array.
To do this for the entire array I use a while loop.
I then limit the width of each line by including at the end of the while loop:
1 2
|
if((i+1)%50==0) //i+1 because the array starts with [0] and it needs to be true at [49]
cout << endl;
|
Now where do I get to use the *line pointer?
Any hints are greatly appreciated.