home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 21198 < prev    next >
Encoding:
Internet Message Format  |  1993-01-11  |  1.9 KB

  1. Path: sparky!uunet!dtix!mimsy!afterlife!mssmith
  2. From: mssmith@afterlife.ncsc.mil (M. Scott Smith)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Think C bug? [sprintf]
  5. Message-ID: <1993Jan11.194525.18175@afterlife.ncsc.mil>
  6. Date: 11 Jan 93 19:45:25 GMT
  7. References: <1ihnnfINNm9p@tamsun.tamu.edu> <1993Jan10.225559.1549@midway.uchicago.edu> <kevin.726748544@crash.cts.com>
  8. Organization: The Great Beyond
  9. Lines: 29
  10.  
  11. Hi..  I'm the original poster who asked about potential problems with sprintf.
  12.  
  13. I received several replies which I'm grateful for.  I apologize for not
  14. providing many details about the specific problem(s) I was having -- it was
  15. not clear to me whether the problems I was having was related to sprintf or
  16. not, and I simply wanted to see if there was a well-known bug in sprintf,
  17. that I hadn't heard about.  I wasn't proposing that there might be a bug.
  18. (I was also under a time deadline.)  Anyway, thanks to those who responded,
  19. and sorry for not being very verbose.
  20.  
  21. It sounds like some people have had no problems with sprintf, while others
  22. have.  I wasn't sure if it was commonly used by Mac C programmers; are there
  23. Toolbox calls (non-ANSI) that Mac pros tend to use instead?
  24.  
  25. Does sprintf only operate with arrays of characters, or will it be happy with
  26. types like Str255?  Or do I have to coerce Str255's to make them work?  I
  27. think some of my problems were traced back to that.  At the same time, I wasn't
  28. sure what the problem was, because something would compile fine one way but
  29. not the next.  (It seems if Think C saw me passing a Str255 to sprintf it
  30. was happy about it; but if later in the program I passed a "real" string to
  31. it, then it suddenly saw problems with one of the calls..  I guess it's checking
  32. types to make sure I'm being consistent.)
  33.  
  34. Is sprintf the best way to capture the functionality of Pascal's concat?
  35.  
  36. Thanks,
  37.  
  38. M. Scott Smith
  39.   (mssmith@afterlife.ncsc.mil)
  40.