//a pointer to the first block of screen
int far *SCR = (int far *) 0xB8000000;
(SCR + 6 * 80 + 31) += "HELLO HELLO HELLO";
In the code above, I defined SCR which is a pointer to the first block of the screen in text mode. It works correctly and I can write on the screen in text mode as below:
#define WHITE 3840
*(SCR + 6 * 80 + 31) = 'h' + WHITE;
*(SCR + 6 * 80 + 32) = 'e' + WHITE;
*(SCR + 6 * 80 + 33) = 'l' + WHITE;
*(SCR + 6 * 80 + 34) = 'l' + WHITE;
*(SCR + 6 * 80 + 35) = 'o' + WHITE;
but when I want to write something long in the screen and when I attempt to write as below I see an error of Lvalue required from the last line in the code written below:
#define WHITE 3840
for(int i = 31; i < 36; i++)
*(SCR + 6 * 80 + i) = WHITE;
(SCR + 6 * 80 + 31) += "hello";
Why I cannot have access to the pointer such as above and how I can fix my problem in writing long words and sentences with the pointer SCR I defined?
+=does not automatically loop over the elements of an array.+=. but then how I can add pen color to that if I am supposed not to use+=?Lvalue requiredchars I'd declareSCRthis way:char far * SCR = (char far *) 0xB8000000;