cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/16/00:56:11

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: ultoa
Date: Sat, 15 Feb 1997 22:38:40 -0800
Organization: Two pounds of chaos and a pinch of salt
Lines: 33
Message-ID: <3306AB70.B7B@cs.com>
References: <5e306n$pj8 AT news00 DOT btx DOT dtag DOT de>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp209.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Gunnar Beushausen wrote:
> 
> Is there in DJGPP an ultoa function implemented? When i'm doing this,
> djgpp says implicit delcaration and it doesn't work:
> 
> strcpy(str, ultoa(long, string, 10));

That may be an omission....  in any case, you can write your own 'ultoa'
that uses sprintf() to print the unsigned long to a buffer, and returns
the buffer.

> Or the same thing into another Question. How can i generate the
> following string:
> 
> str = "Remaining physical memory: XX\n Remaining virtual memory: XY\n"
> 
> where XX is _go32_dpmi_remaining_physical_memory
> and XY is _go32_dpmi_remaining_virtual_memory

Use sprintf() as follows:

char str[80];

sprintf( str, "Remaining physical memory: %lu\nRemaining virtual memory:
%lu\n", _go32_dpmi_remaining_physical_memory(),
_go32_dpmi_remaining_virtual_memory() );

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I |        fighteer AT cs DOT com          |
| Proud owner of what might one   |   http://www.cs.com/fighteer    |
| day be a spectacular MUD...     | Plan: To make Bill Gates suffer |
---------------------------------------------------------------------

- Raw text -


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