Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!nosc!ucsd!rutgers!mit-eddie!uw-beaver!ubc-cs!alberta!simon From: simon@alberta.UUCP (Simon Tortike) Newsgroups: comp.sys.mac.programmer Subject: Re: LSC malloc returning garbage? Summary: double strtod(const char *s, char **endp) What should I use? Message-ID: <1585@pembina.UUCP> Date: 12 Sep 88 02:46:48 GMT Organization: U. of Alberta, Edmonton, AB Lines: 16 I am writing an application that requires me to change a string into a float or double number. The input is already partly filtered (a filterproc in a modal dialog) but I still need to check the exponentiation, etc. K&R (2nd. ed) document `double strtod(const char *s, char **endp)' as part of the header file , which returns information in *endp whether the entire string was converted. In my case, I wish to reject the number if this is so. `atof(s)' only returns the converted number up to the first invalid character, with no info. about the conversion. However, `strtod' is undocumented in my versions of LSC (2.15) (3.0 upgrade on order for over two months ago: I'd buy it from MacWarehouse now but Symantec have our cheque) and MPW C (v2.0.2). Could someone suggest what else I could try short of writing a scanning routine of my own? (Meanwhile, I suppose I shall!) ------------------- Simon Tortike, Department of Mining, Metallurgical and Petroleum Engineering, The University of Alberta, Edmonton, AB, CANADA T6G 2G6. simon@alberta.uucp | AGT: 403/432-3338 | stortike@ualtavm.bitnet