Thread: what's WORD and DWORD?

  1. #1
    Unregistered
    Guest

    Unhappy what's WORD and DWORD?

    Can anyone help out?
    What values do they hold?

  2. #2
    Blank
    Join Date
    Aug 2001
    Posts
    1,034
    Well the way microsoft and intel use them is
    word 16 bits
    dword 32 bits

  3. #3
    Unregistered
    Guest
    can someone give an example for each (some declaration perhaps)?

    so far, WORD is 16 bit and DWORD (I'm assuming "double word") is 32 bit.

    are they used to hold chars or something?

  4. #4
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    that, or ebonics... word... word... [abbreviated as dword... for convienience...]
    hasafraggin shizigishin oppashigger...

  5. #5
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    They hold numbers. For example:

    #include <iostream.h>
    #include <conio.h>
    #include <stdio.h>
    #include <windows.h>
    int main(void)
    {
    DWORD start, end;

    cout << "Hello." << endl;
    start = GetTickCount();
    Sleep(1000);
    end = GetTickCount();
    printf("start:%lu end:%lu\n",start,end);
    printf("millisec elapsed: %lu\n",end-start);
    cout << "Good bye." << endl;
    cout << "Press <enter> to continue ...";
    getch();
    return 0;
    }

  6. #6
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    Their basis is the word size of the processor (the width of it's registers). So a 16bit processor would have a word size of 16, a 32bit -32 etc. However the meaning has been altered slightly so that a WORD is always 16bit and a DWORD(double word) is 32bit, and I assume 64bit will be QWORD. A WORD is an unsigned 16bit integer and a DWORD is an unsigned 32bit integer, so they can hold variables of these types (or types that can be converted to one of them).
    zen

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  2. Dword / Word
    By l2u in forum C++ Programming
    Replies: 7
    Last Post: 06-14-2006, 07:08 AM
  3. Reading a bitmap image
    By usamaalam in forum C Programming
    Replies: 19
    Last Post: 03-06-2004, 06:13 AM
  4. storage size of regs is unkown
    By Vertex34 in forum C Programming
    Replies: 5
    Last Post: 11-04-2003, 10:17 AM
  5. which is faster? DWORD or WORD?
    By mickey in forum Windows Programming
    Replies: 4
    Last Post: 07-20-2002, 12:10 PM