About C programming-VDU memory

Is there something gone wrong in the below
program.Because when i execute this program i will get infinite output.Actually,I wrote this program for flipping the characters on the screen.I mean this program converts the small case letters into capital case letters & vice-versa infinite times present at a particular address so that the output appears as the characters flipping on the screen.But i didnt get this effect.Why?And on my pc windows-xp is installed & i use turbo c.
void main()
int i;
char far *s;

s=(char far *)0xB8000000;
if(*(s+i)>='A' && *(s+i)<='Z')
if(*(s+i)>='a' && *(s+i)<='z')


  • Your program is stepping through screen memory, flipping all the lower case letters to upper case letters and vice versa. But it's doing that in an infinite loop. So you'll get some sort of funny result.

    What you need to do is to put in a pause after each pass through the screen, so that the video display can be updated, and the user can take in the result. Calling sleep() for one second will probably do the trick.

    Read my books
    [link=http://www.lulu.com/bgy1mm] MiniBasic how to write a script interpreter [/link]
    [link=http://www.lulu.com/bgy1mm] Basic Algorithms (in C) [/link]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion