home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / mac / programm / 18537 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.8 KB

  1. Path: sparky!uunet!caen!destroyer!news.itd.umich.edu!potts
  2. From: potts@oit.itd.umich.edu (Paul Potts)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: faulty ANSI in Think C 5.0?
  5. Date: 17 Nov 1992 19:13:57 GMT
  6. Organization: Instructional Technology Laboratory, University of Michigan
  7. Lines: 26
  8. Message-ID: <1ebg9lINNi8e@terminator.rs.itd.umich.edu>
  9. References: <1992Nov16.211648.23619@math.ucla.edu>
  10. NNTP-Posting-Host: helen.oit.itd.umich.edu
  11.  
  12. In article <1992Nov16.211648.23619@math.ucla.edu> dchopp@vicente.math.ucla.edu (David Chopp) writes:
  13. >I'm curious if others have run into similar problems as I regarding using
  14. >some ANSI subroutines in Think C 5.0.2 with TCL.  In particular, I have
  15. >trouble using strcpy, strcmp, sprintf, to name a few.  I have found them
  16. >to be sporadic in working properly and I'm wondering if I'm doing something
  17. >wrong.  For example, in one object, I'll have two methods each using strcpy
  18. >in them (all in the same file).  In one context, it works perfectly, in the
  19. >other it fails to copy.  The arguments being passed are all correct (I've
  20. >checked them several times).  
  21.  
  22. I'd say it is most likely that there is a problem in your program. I've
  23. used sprintf, strcpy, strcmp, etc. and had them work fine. 
  24.  
  25. Some things to consider: are you testing the arguments under the source-level
  26. debugger, or at runtime under MacsBug? The source-level debugger and the
  27. low-level debugger can show different things. Under the source debugger
  28. sometimes memory is better initialized, pointers tend not to penalize you
  29. for writing to stray addresses, etc. Whenever I've had problems using
  30. the string routines, they were caused by some other part of my code which
  31. was trashing memory at runtime.
  32.  
  33. Post some examples, maybe that would help.
  34.  
  35. -- 
  36. Politics is crime pursued by other means.              
  37. potts@oit.itd.umich.edu      CI$ 71561,3362 (rarely)
  38.