|
I'd be more than willing to help with a solution, but as Valmont says, theres several ways to do it. One could be very intuitive, given teknos advice, another could be extremly overkill, taking part in your char pointer request...
Start by thinking of the array as a queue, then think of a simple loop to go through that queue, then considder the modulus operator in combination with the length of the array, then you might be onto one solution which would work, next, do the same with the string as a char pointer (where you'd query the address location) then think of a way to know, when that reaches the end of the array, then think of a loop, which would wrap around, once the end is met, then you'd might be onto a second solution, which uses a char pointer reference...
Then design a seperate string class, which has its own std::ostream << operator, which would circle the string once, then think of a.... Nah, that would simply be too much overkill...
|