www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/22/13:06:23

Message-Id: <m0zWP49-000S4NC@inti.gov.ar>
Comments: Authenticated sender is <salvador AT natacha DOT inti DOT gov DOT ar>
From: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT gov DOT ar>
Organization: INTI
To: ummurr03 AT cc DOT umanitoba DOT ca (LupusNoctus), djgpp AT delorie DOT com
Date: Thu, 22 Oct 1998 15:22:52 +0000
MIME-Version: 1.0
Subject: Re: conversion int-->string
In-reply-to: <3634626c.29813659@news.cc.umanitoba.ca>
X-mailer: Pegasus Mail for Windows (v2.54)
Reply-To: djgpp AT delorie DOT com

ummurr03 AT NOSPAMcc DOT umanitoba DOT ca (LupusNoctus) wrote:

> How does one go about putting the value of an int variable into a
> string variable?   it's not str dummy=intvar; that gives ascii value.
 
Use the sprintf function. For example:

int a;
char string[12];

a=599;
sprintf(string,"%X",a); 
printf("%s\n",string);

SET
------------------------------------ 0 --------------------------------
Visit my home page: http://set-soft.home.ml.org/
or
http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013

- Raw text -


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