Originally Posted by
SilverSteel
"if NOT EQUAL to any numerical value"
It's in the FAQ:
http://faq.cprogramming.com/cgi-bin/...043284385#opt3
A related good read:
http://home.att.net/~jackklein/c/code/strtol.html
But where is that icky thing I wrote a while ago?
[search...]
[search...]
[search...]
Code:
#include<stdio.h>
#include<string.h>
char*q(char*o){char*s=o,*e=s+strlen(s)-1;while(s
<e){char t=*e;*e--=*s;*s++=t;}return o;}char*u(a
,b,c,n)char*a,*b,*c;size_t n;{char*d=a,*e=b,*f=c
;int x=0;a=q(a);b=q(b);for(;;){int y=0;if(c>=&f[
n-1]){return 0;}if(*a){y+=*a-'0';++a;}if(*b){y+=
*b-'0';++b;}y+=x;x=y>10;if(!y&&!*a&&!*b){break;}
else if(y>9){x=1;y-=10;}else{x=0;}*c++=y+'0';}*c
='\0';;strcpy(d,q(e));strcpy(e,q(f));return(f);}
char A[1024]="0";char B[sizeof(A)/sizeof(*A)]="\
1";char C[sizeof(A)/sizeof(*A)];;int main(){char
f[]="f(%d)= %s\n";int i=0;printf(f,i++,A);printf
(f,i++,B);while(i<=10000){char*c=u(A,B,C,sizeof(
C));if(!(c)){break;}printf(f,i++,c);}return(0);}