FROM : Dr. H. Nikolaus Schaller
DATE : Sat Jan 18 21:31:09 2003
Hi,
good idea to solve this discussion thread. To me it seems to need less
typing effort to submit a one-liner (cited from memory from old K&R
Standard C) than a discussion about libraries, standards, OS versions
etc.:
int atoi(char *str) { int n=0; while(*str >='0' && *str <='9')
n=10*n+(*str++-'0'); return n; }
This will work as long as the machine code can somehow be interpreted...
Or try: sscanf(str, "%d", &i) instead of i=atoi(str)
HNS
Am Freitag, 17.01.03 um 14:51 Uhr schrieb Andy Lee:
> At 6:49 AM -0600 1/17/03, Philip George wrote:
>> Actually, OS X is really the only target OS where I definitely need
>> the code to run on the OS's earliest release (10.0). As far as
>> Linux, BeOS, and Windows NT go, it's not so crucial.
>
> Why not write your own ASCII-to-integer function? Seems to me you
> could do this in a portable way, at very little cost in programming
> time, performance, or risk.
>
> Of course, if you are dealing with other deprecated functions, it may
> not be so simple.
>
> --Andy
> _______________________________________________
> cocoa-dev mailing list | <email_removed>
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
> Do not post admin requests to the list. They will be ignored.
>
>
+-------------------+
! <email_removed> !
+-------------------+
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Sat Jan 18 21:31:09 2003
Hi,
good idea to solve this discussion thread. To me it seems to need less
typing effort to submit a one-liner (cited from memory from old K&R
Standard C) than a discussion about libraries, standards, OS versions
etc.:
int atoi(char *str) { int n=0; while(*str >='0' && *str <='9')
n=10*n+(*str++-'0'); return n; }
This will work as long as the machine code can somehow be interpreted...
Or try: sscanf(str, "%d", &i) instead of i=atoi(str)
HNS
Am Freitag, 17.01.03 um 14:51 Uhr schrieb Andy Lee:
> At 6:49 AM -0600 1/17/03, Philip George wrote:
>> Actually, OS X is really the only target OS where I definitely need
>> the code to run on the OS's earliest release (10.0). As far as
>> Linux, BeOS, and Windows NT go, it's not so crucial.
>
> Why not write your own ASCII-to-integer function? Seems to me you
> could do this in a portable way, at very little cost in programming
> time, performance, or risk.
>
> Of course, if you are dealing with other deprecated functions, it may
> not be so simple.
>
> --Andy
> _______________________________________________
> cocoa-dev mailing list | <email_removed>
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
> Do not post admin requests to the list. They will be ignored.
>
>
+-------------------+
! <email_removed> !
+-------------------+
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| Philip George | Jan 17, 08:44 | |
| John C. Randolph | Jan 17, 09:16 | |
| Philip George | Jan 17, 10:29 | |
| Chris Ridd | Jan 17, 11:52 | |
| Philip George | Jan 17, 13:08 | |
| Barry Books | Jan 17, 13:39 | |
| Philip George | Jan 17, 13:49 | |
| Andy Lee | Jan 17, 14:51 | |
| Clark S. Cox III | Jan 17, 15:32 | |
| MarketLogix Develo… | Jan 17, 16:54 | |
| John C. Randolph | Jan 17, 21:25 | |
| Philip George | Jan 17, 23:17 | |
| Dr. H. Nikolaus Sc… | Jan 18, 21:31 |






Cocoa mail archive

