home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!europa.eng.gtefsd.com!emory!sol.ctr.columbia.edu!spool.mu.edu!olivea!sgigate!sgi!wdl1!pulsar!dboddy
- From: dboddy@pulsar.lrmsc.loral.com (Dave Boddy 5973)
- Newsgroups: comp.lang.c
- Subject: Re: Integter to ASCII conversions
- Message-ID: <1993Jan28.192812.3579@wdl.loral.com>
- Date: 28 Jan 93 19:28:12 GMT
- References: <19460002@hpcss01.cup.hp.com> <1993Jan28.152011.1308@uvm.edu>
- Sender: news@wdl.loral.com
- Organization: Loral Rolm Mil-Spec Computers
- Lines: 24
-
- In article <1993Jan28.152011.1308@uvm.edu> cblaise@moose.uvm.edu (Chris Blaise,Free Amy Fisher!) writes:
- >
- > Anyone know of a library function to convert an integer
- >to a string? I've search high and low and am about to break
- >down and write my own...
- >
- > Thanks
- > TTYL
- > Chris
-
- You can use the sprintf function to do this i.e.
-
- int num;
- char s[10];
-
- num= 4;
- sprintf(s,"%d",num);
- /* s now has the ascii equivalent of num */
-
-
- --
- -----------------------------------------------------------------------------------
- Hey! They're lighting their arrows!...Can they DO that? (Gary Larson)
- DoD # 0677 (408) 432-5973 dboddy@pulsar.lrmsc.loral.com
-