www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/08/18:01:30

From: "A. Sinan Unur" <sinan DOT unur AT cornell DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: integer to string
Date: Sun, 08 Feb 1998 15:35:18 -0500
Organization: Cornell University (http://www.cornell.edu/)
Lines: 18
Sender: asu1 AT cornell DOT edu (Verified)
Message-ID: <34DE1705.A3E6F7ED@cornell.edu>
References: <34DE1449 DOT 185C AT bellsouth DOT net>
NNTP-Posting-Host: cu-dialup-2021.cit.cornell.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Lester Davis wrote:
> 
> Im tring to insert the num rturned by getpid(unix sytem call) into a
> string. cna someone tell me how to do this if the
>  int is Mypid and the ptr to the string is *str.

assuming str points to valid storage,

sprinf(str, "%d", mypid);

-- 
----------------------------------------------------------------------
A. Sinan Unur
Department of Policy Analysis and Management, College of Human Ecology,
Cornell University, Ithaca, NY 14853, USA

mailto:sinan DOT unur AT cornell DOT edu
http://www.people.cornell.edu/pages/asu1/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019