Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!ncar!gatech!mcnc!rti!dg-rtp!gamecock!hagins From: hagins@gamecock.rtp.dg.com (Jody Hagins) Newsgroups: comp.lang.c Subject: Re: "1234" ==> 1234 (char * ==> int) Keywords: obnoxious Message-ID: <1990Dec17.200701.17465@dg-rtp.dg.com> Date: 17 Dec 90 20:07:01 GMT References: <1990Dec12.215359.5378@cs.utk.edu> <5372@rossignol.Princeton.EDU> Sender: usenet@dg-rtp.dg.com (Usenet Administration) Reply-To: hagins@gamecock.rtp.dg.com (Jody Hagins) Organization: Data General Corporation, Research Triangle Park, NC Lines: 31 In article <5372@rossignol.Princeton.EDU>, nfs@hart.Princeton.EDU (Norbert Schlenker) writes: |> In article <1990Dec12.215359.5378@cs.utk.edu> lape@.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@gamecock.rtp.dg.com Data General Corp. 62 Alexander Dr. RTP, N.C. 27709 (919) 248-6035