declaration

This is a discussion on declaration within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I'm a novice..now i'm learning how to write a graphic program in C. I've browsed through the Web http://www.brackeen.com/home/vga/basics.html and ...

  1. #1
    Clay
    Guest

    Angry declaration

    I'm a novice..now i'm learning how to write a graphic program in C. I've browsed through the Web http://www.brackeen.com/home/vga/basics.html
    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
    Posts
    2,572
    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 :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

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, 11: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, 07:39 AM

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