Showing tag results for History

Apr 29, 2008
Post comments count0
Post likes count0

Why do atoms start at 0xC000?

Raymond Chen
Raymond Chen

There are two types of atoms, so-called integer atoms, which are just small integers, and, um, atoms that don't have a special adjective; these plain vanilla atoms come from functions like . (For the purpose of this discussion, I'll call them string atoms.) The atom zero is invalid (); atoms 1 through † are integer atoms, and atoms from thr...

History
Mar 27, 2008
Post comments count0
Post likes count0

Why do structures get tag names even if there is a typedef?

Raymond Chen
Raymond Chen

As we noted last time, structure tags are different from the typedef name as a historical artifact of earlier versions of the C language. But what about just leaving out the name entirely? One problem with this approach is that it becomes impossible to make a forward reference to this structure because it has no name. For example, if you wanted...

History
Mar 26, 2008
Post comments count0
Post likes count0

Why are structure names different from their typedef names?

Raymond Chen
Raymond Chen

In Windows header files, many structures are declared like this: Why is the structure name different from typedef name? This is a holdover from very early versions of the C language where structure tags, union tags, and typedefs were kept in the same namespace. Consequently, you couldn't say . At the open brace, the compiler registers as a s...

History
Mar 25, 2008
Post comments count0
Post likes count0

What's the difference between int and INT, long and LONG, etc?

Raymond Chen
Raymond Chen

When you go through Windows header files, you'll see types with names , , , and so on. What's the difference between these types and the uncapitalized ones? Well, there isn't one any more. What follows is an educated guess as to the story behind these types. The application binary interface for an operating system needs to be unambiguous. Everyb...

History
Mar 7, 2008
Post comments count0
Post likes count0

Why can't I convert a time zone abbreviation into a time zone?

Raymond Chen
Raymond Chen

Suppose you have a string of the form . How can you parse this into something your program can manipulate, like say a or a ? Basically, you can't in the general case. The time zone abbreviation CST is ambiguous. It could mean U.S./Canada Central Standard Time, Australian Central Standard Time, China Standard Time, or Cuba Summer Time. There ma...

HistoryTime
Feb 28, 2008
Post comments count0
Post likes count1

Why are process and thread IDs multiples of four?

Raymond Chen
Raymond Chen

On Windows NT-based operating systems, process and thread IDs happen always to be a multiple of four. Is this just a coincidence? Yes, it's just a coincidence, and you shouldn't rely on it since it is not part of the programming contract. For example, Windows 95 process and thread IDs were not always multiples of four. (By comparison, th...

History
Feb 11, 2008
Post comments count0
Post likes count0

Why does Ctrl+ScrollLock cancel dialogs?

Raymond Chen
Raymond Chen

Commenter Adam Russell asks why Ctrl+ScrollLock cancels dialogs. Easy. Because Ctrl+ScrollLock is the same as Ctrl+Break, and Ctrl+Break cancels dialogs. Okay, that answer actually raises two more questions. First, why is Ctrl+ScrollLock the same as Ctrl+Break? This is a consequence of the backward compatibility designed into the Enhanced Keyboa...

History