I have a function that I dont quite understand
There are 109 addresses from 0 to 110.
How is this code shifting text to the left ?
b=0;
while(b<109)
{
Display_Buffer[b] = Display_Buffer[b+1];
b++;
}
if b starts at 0, then b+1 should scroll the text to the RIGHT instead ??? Or am I getting this wrong ? because at 0, b+1 means the address is 1, if its b-1, then the address should be 110 (hence scrolling left) … But thats not the case here, can someone provide a rough explanation ?
The display_buffer contains the string information stored in its arrays.
—
EDIT
Thanks guys !! What if I replaced Display_Buffer[b+1] with [b-1] … will this reverse the process ? how ?
Okay I realized I have to add b=109 and while (b!=0) .. or else that wont make sense.
But still, if Display_Buffer[109]=Display_Buffer[108], does that mean it will produce the same effect as you guys answered but in reverse ?
When you do this kind of things, you must take care to not overwrite from the wrong direction …
To do the same thing from the end