Enclosed, is a question I got from let us c. I attached it as a file so I can share the question itself. I want to ask if I can attempt this on a Linux machine as this book was written for Turbo C I believe. Also the answer has some things I have not seen before, and I wanted to discuss it in a way that allows me understand the problem and perhaps write my version of the code, which accomplishes the same thing. I am trying to do these on an Ubuntu machine with gcc. So below is the code with my questions posted as comments:
Code:#include <stdio.h> int main() { char far *scr = 0xB8000000; // What is a far pointer? // Is the value 0xB8000000 the same for my environment? int i; while (!kbhit()) // The original answer uses the dos.h, which I do not have // Is there some other header file I can use to accomplish the same? { for (i=0; i<4000; i+=2) if (scr[i] >='A' && scr[i] <= 'Z') { scr[i] += 32; } else { if (scr[i] >='a' && scr[i] <='z') scr[i] -= 32; } } } }