home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!wupost!spool.mu.edu!umn.edu!lynx!deepthought.unm.edu!peter
- From: peter@deepthought.unm.edu (Peter Blemel)
- Subject: Why would someone put 'char x[]' inside of a struct decl?
- Message-ID: <wyrr3hn@lynx.unm.edu>
- Date: Fri, 01 Jan 93 02:52:27 GMT
- Organization: Disorganization
- Lines: 33
-
- I'm trying (really I am) to write a Microsoft Windows app, and I've come across
- a structure (Prog ref, vol 4 pg90) that looks something like...
-
- struct DialogBoxHeader {
- .
- .
- .
- char szMenuName[];
- .
- .
- char szFaceName[];
- };
-
- First, this reference sucks. It doesn't explain how to use this and a companion
- structure (on the following page) together. Second, I can't figure out how to
- initialize this structure(?). szMenuName isn't allocated any storage, and I can't
- allocate any for it because it's not a lvalue.
-
- Has Windows finally driven me over the edge? Am I crazy? Is there a way to initialize
- this structure?
-
- None (0) of the reference books I own (Including Petzold, all the Prog. Ref. Lib,
- and about 4 other books) discusses how to use DialogBoxIndirect(). I did find in
- one of my 3.0 manuals (the Microsoft Prog. Ref. Manuall) says the second structure
- must follow 'the terminating null of the szFaceName element'. Does this mean that
- this isn't really a struct at all, but just a bunch of data stuffed into memory one
- after another, with szMenuName, szFaceName, etc varying in length and the elements
- that follow them just sitting after their terminating '\0's? (If you ask me, that
- is _not_ a structure, and _certainly_ shouldn't be "documented" with C syntax!)
-
- Lobotomized minds want to know...
-
- Peter
-