Address_problem

This is a discussion on Address_problem within the C Programming forums, part of the General Programming Boards category; hello... i wrote this program to fill the screen with 2000 copies of single of character, by acces the address ...

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    2

    Address_problem

    hello...
    i wrote this program to fill the screen with 2000 copies of single of character, by acces the address of memory on video memory
    but this program does not work well....help plz

    here is the code...

    #include<stdio.h>
    #include<conio.h>
    #define LENGTH 2000
    void main(void)
    {
    int far *farptr;
    int position;
    char ch;
    printf("\nType character to start, type again to change");
    farptr= (int far *) 0XB800000L;
    while((ch=getch()) != '\r')
    for(position=0; position<LENGTH; position++)
    *(farptr + position)= (int)ch | 0x0700;
    }

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,833
    Please use [code][/code]Tags

    Unless your OS is really DOS (not some emulation in say XP), then it isn't going to work.

    It's been at least a decade since anyone did any serious work with such old compilers, perhaps it's time you upgraded.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21