"1234" ==> 1234 (char * ==> int)

Jody Hagins hagins at gamecock.rtp.dg.com
Tue Dec 18 07:07:01 AEST 1990


In article <5372 at rossignol.Princeton.EDU>, nfs at hart.Princeton.EDU (Norbert Schlenker) writes:
|> In article <1990Dec12.215359.5378 at cs.utk.edu> lape at .cs.utk.edu (Bryon S. Lape) writes:
|> >	I need to know how to convert a string of numbers into an int.
|> >For example, "1234" ==> 1234.  I am interested in all theories, so please
|> >send whatever you know or think.  Also, please e-mail the responses.
|> 
|> Here's a theory of conversion a couple of us thought up while playing
|> bridge the other night.  Take the outputs from your system standard
|> random number generator, convert them to a string, and compare them to
|> the input string.  If the strings don't match, try another random number.
|> If your random number generator is full period and the input string is
|> in range and in canonical form, this approach is guaranteed to succeed.


[ C source deleted ]



One of the best responses of the decade.
Couldn't stop laughing.
Now I have to go to the bathroom...


-- 

Jody Hagins             
hagins at gamecock.rtp.dg.com    
Data General Corp.      
62 Alexander Dr.        
RTP, N.C.  27709        
(919) 248-6035          



More information about the Comp.lang.c mailing list