Here's the answer I got from one of my C wizard friend... :-)
Pierre Phaneuf
"The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offense." - Edsger W. Dijkstra.
---------- Forwarded message ---------- Date: Wed, 28 May 1997 17:00:03 -0400 From: stephane.lajoie@belairdirect.com To: pierre@tycho.com Cc: grendel@hoth.amu.edu.pl Subject: Re: A question for the C wizards... ;-)
itoa is in stdlib.h/libc.a for DJGPP. I thought it was ANSI C...? Anyway, I would suggest sprintf like this:
sprintf(buf, "%i", i);
Where buf is a pre-allocated buffer big enough for a decimal representation of an int and i is the value to convert. You loose the radix parameter, though.
extern int _fmode is a DOS thing. If the value is O_TEXT, carriage return (0x0D) characters will be stripped on reads and added on writes as needed. Simply comment out all references to _fmode, O_TEXT and O_BINARY if __DOS__(or whatever) is not defined. The 'b' you might see in the mode string of fopen calls (ex: fopen("BobTheFile", "rb"); )is the same: simply remove it when not in DOS.