Dealing with Strings

An integer is an integer is an integer in any language, but every language has its own ideas about strings. In Basic, a string is supposed to be a black box. You put data in through Basic statements; the system allocates, moves, and resizes the data without your knowledge or interference; you get data back in the expected format. In C, in contrast, you must understand exactly how strings are stored in memory to process them correctly and efficiently. Nothing is allocated, moved, or resized unless you do it.

This fundamental difference between C strings and Basic strings is probably the biggest problem you face in dealing with the Windows API. Essentially, you have to get un-Basic with strings—you have to know what Basic programmers aren’t supposed to know.