delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2005/09/07/17:45:29

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
NNTP-Posting-Date: Wed, 07 Sep 2005 16:41:35 -0500
Date: Wed, 07 Sep 2005 17:41:35 -0400
From: Joe Wright <jwright AT comcast DOT net>
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Pb with sprintf
References: <dfmqgu$mfs$1 AT s1 DOT news DOT oleane DOT net>
In-Reply-To: <dfmqgu$mfs$1@s1.news.oleane.net>
Message-ID: <gL-dnSZBgocSw4LeRVn-uQ@comcast.com>
Lines: 33
NNTP-Posting-Host: 69.143.13.12
X-Trace: sv3-f773wUswrZupcg1vd3poMJ3SE0xY2KeAzU2WKqSlrGnCgFGOxiD3ODVup6r1l89Hpbcsl+xHlJJybm/!+4HogPP34c4o62t83C5eAwI7Izjvh/Pt5Ob4wozGla0JOfFeGaKpf9zaZLwCUfEcCk3sbQBplRg2!9Q==
X-Complaints-To: abuse AT comcast DOT net
X-DMCA-Complaints-To: dmca AT comcast DOT net
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.32
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

philippe meynard wrote:
> Hi! All
> 
> do you know if the function sprintf used dos call dpmi_int (0x21) or return
> the processor to the real mode or used malloc ?
> Because I use LWP (multitasking library) and I have a crash on this function
> sprintf !
> I used sprintf like this :
> 
> char chaf[100];
> sprintf(chaf,"%d\n",100);
> 
> 
> Thanks.
> 
> 
> 
#include <stdio.h>
#include <string.h>

int main(void) {
    char chaf[100];
    sprintf(chaf, "%d", 100);
    printf("chaf length is %d and looks like %s\n",
       strlen(chaf), chaf);
    return 0;
}

Can't guess your problem. The above code works fine here.
-- 
Joe Wright
"Everything should be made as simple as possible, but not simpler."
                     --- Albert Einstein ---

- Raw text -


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