Showing tag results for History

Mar 27, 2008
Post comments count0
Post likes count1

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

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 count1

Why are structure names different from their typedef names?

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 count1

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

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 count1

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

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 count2

Why are process and thread IDs multiples of four?

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 count1

Why does Ctrl+ScrollLock cancel dialogs?

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
Feb 8, 2008
Post comments count0
Post likes count1

Why couldn't you have more than one instance of a 16-bit multi-DS program?

Raymond Chen

Recall that the identified a set of variables. This causes a bit of a problem if your program has multiple data segments; in other words, multiple sets of variables. In such a program, the code would load the data segment of whatever variable it needed each time it needed to access a variable from a different segment. This was no problem at all f...

History