home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / c / 19999 < prev    next >
Encoding:
Internet Message Format  |  1993-01-21  |  2.8 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!neoucom.edu!aldhfn!Dean_Wagner
  2. From: Dean_Wagner@aldhfn.akron.oh.us (Dean_Wagner)
  3. Subject: More help (mostly os2/dos specific)
  4. Newsgroups: comp.lang.c
  5. Summary: 
  6. Keywords: 
  7. X-Newsreader: TIN [version 1.1 PL8]
  8. Message-ID: <Dean_Wagner.49sy@aldhfn.akron.oh.us>
  9. Date: 20 Jan 93 21:56:55 EST
  10. Organization: Auldhaefen Associates
  11. Lines: 55
  12.  
  13. Thanks to all who responded to my question about text entry.  I was looking
  14. for a way to have the cursor not enable a person to enter more than
  15. MAX_LENGTH characters.  My actual problem was lack of a null ending my
  16. string.
  17.  
  18. Here's some more things I could use some help with:
  19.  
  20. 1)   do Microsoft C DOS graph functions work with os2?  I was trying to
  21. use clearscreen, but got an unresolved external from inside the library
  22. function.  I don't have the exact error here, but it said something like
  23. (..\gr\something.asm: ___somevar).  Does this mean the graphics library
  24. uses something defined in the asm file (which obviously isn't there)?  I
  25. reinstalled the compiler, but got no option to load that file, or anything
  26. in a gr directory.
  27.  
  28. 2)   This was a problem I had at work, and it was solved, but the
  29. solution required changing the question - I was curious about the solution
  30. to the question as it originally was:
  31.      Given a 2-dimensional array, how is it possible to dynamically
  32. allocate memory for the first dimension?  In other words, I wanted to
  33. changed the declaration from
  34. record[56][5] to
  35. *record[5] or record[][5]
  36.  
  37. I tried several ways to allocate memory for this definition, but couldn't
  38. figure out what I was doing wrong.  Here were the suggestions from co-
  39. workers...
  40.      Change the second dimension to a structure (works, but I didn't
  41.      want to rewrite the program, just make it more versatile)
  42.  
  43.      record = malloc(sizeof(int)*5*number) - it wouldn't let me, saying
  44.      that record must be an lvalue.
  45.  
  46.      allocate 4k, since that's the smallest size possible with os2
  47.      anyways.  
  48.  
  49. The final solution, which was "why bother?  the largest number possible is
  50. 64", made me beat myself over the head many, many times.  Anyways, I'm
  51. still wondering how I would have allocated the memory, given the
  52. declarations mentioned above.
  53.  
  54. 3)   Can anyone suggest a good manual for programming software to be
  55. used ona BBS?  That's what I'm doing now, and it's something I never did in
  56. school or elsewhere.
  57.  
  58. 4)   Is there any representation for the delete key in printf?  Right
  59. now, I use "\b \b", which backspaces, spaces, and backspaces again.  It's
  60. functional, but certainly not efficient.
  61.  
  62. Thanks in advance,
  63.  
  64. --
  65. Dean Wagner                        Nothing matters but the weekend
  66. Dean_Wagner@aldhfn.akron.oh.us    From a Tuesday point of view
  67. bx451@cleveland.freenet.edu             -Switch into Glide, The Kings
  68.