home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / c / 12594 < prev    next >
Encoding:
Text File  |  1992-08-20  |  1.3 KB  |  37 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!stanford.edu!agate!overload.lbl.gov!prem.lbl.gov!prem
  3. From: prem@prem.lbl.gov (Shirdi R. Prem)
  4. Subject: Re: Convert float to a string ?
  5. Message-ID: <1992Aug20.225133.12163@overload.lbl.gov>
  6. Sender: usenet@overload.lbl.gov
  7. Nntp-Posting-Host: prem.lbl.gov
  8. Reply-To: prem@prem.lbl.gov (Shirdi R. Prem)
  9. Organization: Lawrence Berkeley Laboratory
  10. References: <1992Aug19.212749.21008@overload.lbl.gov> <1992Aug20.172112.1564@tin.monsanto.com>
  11. Date: Thu, 20 Aug 1992 22:51:33 GMT
  12. Lines: 23
  13.  
  14. In article <1992Aug20.172112.1564@tin.monsanto.com> bcschu@skws02.monsanto.com (Brett Schultz) writes:
  15. >prem@prem.lbl.gov (Shirdi R. Prem) writes:
  16. >: In article <1992Aug19.204417.13500@tin.monsanto.com> bcschu@skws02.monsanto.com (Brett Schultz) writes:
  17. >: 
  18. >:        sprintf(b,"%f\0",a);
  19. >:              ^^^^^^
  20. >:              ^^^^^^
  21. >: 
  22. >:     Are you sure you need a '\0' here............???
  23. >: 
  24. >:     Prem!  (I guess I should've written a test program to find out, )   
  25. >:            ( rather than posting this..........                     )
  26.  
  27. >No, I'm not sure if one NEEDS a \0 there, but it surely doesn't hurt to put
  28. >one there, now you KNOW that your string is null terminated.
  29. >Let me know if sprintf puts one there anyway, I wasn't sure.
  30. >Brett
  31.  
  32.     Yes. It does.
  33.  
  34.     -Prem!
  35.  
  36.  
  37.