🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #2759

Re: Is this a bug in 16-bit Borland C++?

#2759
From: Scott McKellar
Date: Fri, 11 Aug 1995 14:24
32 lines
1697 bytes
In article <DCzt0H.9JD@nntpa.cb.att.com>, <wolf@beowulf.ho.att.com> writes:
> 
> I have a C++ application that runs fine under various forms of UNIX as
> well as 32-bit MS Windows, but I'm having lots of problems with the 16-bit
> code (it doesn't help much that my background is in UNIX rather than MS :-)
> Aside from various general-application-faults (which went away by 
downsizing
> the size of some of my local arrays), I've noticed the following strange
> output:  I have the following line of code:
> 
> 	static const char string_delimiter = '\"';
> 	char buffer[256];
> 	int num = 5;
> 	sprintf(buffer,"%c%d%c", string_delimiter, num, string_delimiter);
> 	printf(buffer);
> Seems innocent enough, right?  You would think the output would be:
> 	"5"
> But, instead it's:
> 	"5
> (I originally didn't have the escape character in front of the double-quote
> character in string_delimiter - with the same results.)
> 
[ snip ]
For what it's worth, I compiled your snippet under BC++ 3.0, under MS-DOS.
It produced the expected "5".  Between my version and your version, Borland
evidently broke their sprintf.

Scott McKellar
Southwestern Bell Telephone
St. Louis, MO
(314) 235-3595		jm407a@multi.sbc.com
Technical Details
Message-ID: <3868@swuts.sbc.com>
Path: arc1-ca.pugleaf.net!texbell.sbc.com!swuts!multi.sbc.com
References: <DCzt0H.9JD@nntpa.cb.att.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!texbell.sbc.com!swuts!multi.sbc.com
From: jm407a@multi.sbc.com (Scott McKellar)
Newsgroups: comp.os.ms-windows.programmer.misc,comp.lang.c++
Subject: Re: Is this a bug in 16-bit Borland C++?
Message-ID: <3868@swuts.sbc.com>
Date: 11 Aug 95 14:24:50 GMT
References: <DCzt0H.9JD@nntpa.cb.att.com>
Sender: usenet@swuts.sbc.com
Followup-To: comp.os.ms-windows.programmer.misc
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII