From: Erik Max Francis Newsgroups: comp.os.msdos.djgpp Subject: Re: Pointing into a string Date: Fri, 24 Jul 1998 17:59:30 -0700 Organization: Alcyone Systems Lines: 28 Message-ID: <35B92DF2.2704E553@alcyone.com> References: <35b91d1a DOT 2313606 AT news DOT algonet DOT se> NNTP-Posting-Host: charmaine.alcyone.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Nicklas Lindgren wrote: > I want to store an int inside a string. (It must be a string, not a > struct or anything else) > > I've tried to make a pointer of int type into the string but i can't > figure out how to make it work. > > If anyone can tell me how to, or suggest something better, i'd > appreciate it. What do you mean, "store an int inside a string"? Do you mean have a strange which contains the ASCII equivalent of an int? In that case, you should sprintf: int i; /* the int you want "converted" */ char buffer[32]; /* more than you need */ sprintf(buffer, "%d", i); -- Erik Max Francis / email max AT alcyone DOT com / whois mf303 / icq 16063900 Alcyone Systems / irc maxxon (efnet) / finger max AT sade DOT alcyone DOT com San Jose, CA / languages En, Eo / web http://www.alcyone.com/max/ USA / icbm 37 20 07 N 121 53 38 W \ / I've got the fever for the flavor of a cracker / Ice Cube