home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 19104 < prev    next >
Encoding:
Text File  |  1992-12-31  |  1.6 KB  |  43 lines

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