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