delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/25/17:39:38

Message-ID: <3684131B.22EB@cam.org>
Date: Fri, 25 Dec 1998 17:35:07 -0500
From: Vic <tudor AT CAM DOT ORG>
X-Mailer: Mozilla 3.0Gold (Win95; I)
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
To: djgpp AT delorie DOT com
Subject: Re: conversion question
References: <01be301f$9a15ec40$LocalHost AT default>
Reply-To: djgpp AT delorie DOT com

Börje Granberg wrote:
> 
> Hello!
> My name is Börje and I live in Schweden.
> I have problem with my ex of DJGPP:
> I've been working with DJGPP at home for about 4-5 month and now I
> have
> come to the problem that I dont know how to convert a INT to at CHAR*.
> I want the INT I to become a string so I can add a number, let's say
> '123' to
> the string "Look on page " so it will be "Look on page 123".

you don't have to convert it, but you can. You can convert a number to a
string using itoa(number, string*, radix) (look it up in texinfo)
Or, you can use sprintf, which works just like printf but puts the text
into a string:
sprintf(string,"Look on page %d",number)

- Raw text -


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