Thread: declaration

  1. #1

    Angry declaration

    I'm a i'm learning how to write a graphic program in C. I've browsed through the Web
    and got stuck with these declarations :

    typedef unsigned char byte;

    byte far *VGA = (byte far*)0xA0000000L;

    please help me.........i got an assignment from my lecturer that is too hard for me

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    typedef unsigned char byte;

    this tells the compiler that byte is an alias for an unsigned char.

    byte far *VGA = (byte far*)0xA0000000L;

    far means that the memory address is a segment:offset address rather than a near pointer which is just an offset address.

    (byte far*) is a cast.

    0xA0000000L is the start of the video memory on vga systems.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :-

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Quantum Random Bit Generator
    By shawnt in forum C++ Programming
    Replies: 62
    Last Post: 06-18-2008, 10:17 AM
  2. failure to import external C libraries in C++ project
    By nocturna_gr in forum C++ Programming
    Replies: 3
    Last Post: 12-02-2007, 03:49 PM
  3. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  4. Errors with including winsock 2 lib
    By gamingdl'er in forum C++ Programming
    Replies: 3
    Last Post: 12-05-2005, 08:13 PM
  5. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM