PN: Support for common functions not in Ansi Standards

P

Peter Nolan

Hi All,
I am testing some VC++ code from win2000 on a Solaris machine.

I've found a couple of functions that are in VC++ but not the sun
compiler. The two so far are:

itoa - Integer to asci string
fcvt - Floating point to ascii string (at least I think this will be
missing as I have not tested it yet.)

I was wondering if there was any public functions written in C that I
could use to give the same functionality as in VC++?

I am guessing these routines are so common that someone must have
written and published some common functions.

(I have used sprintf to emulate itoa on base10 numbers...)

Thanks
Peter Nolan
www.peternolan.com
 
R

Rolf Magnus

Peter said:
Hi All,
I am testing some VC++ code from win2000 on a Solaris machine.

I've found a couple of functions that are in VC++ but not the sun
compiler. The two so far are:

itoa - Integer to asci string
fcvt - Floating point to ascii string (at least I think this will be
missing as I have not tested it yet.)

I was wondering if there was any public functions written in C that I
could use to give the same functionality as in VC++?

I am guessing these routines are so common that someone must have
written and published some common functions.

(I have used sprintf to emulate itoa on base10 numbers...)

You should use a stringstream. It provides the requested operations.
However, it doesn't do arbitrary bases, but only 10 and 16 (and maybe
2) AFAIK. Can't sprintf do that, too?
 
L

lilburne

Peter said:
Hi All,
I am testing some VC++ code from win2000 on a Solaris machine.

I've found a couple of functions that are in VC++ but not the sun
compiler. The two so far are:

itoa - Integer to asci string
fcvt - Floating point to ascii string (at least I think this will be
missing as I have not tested it yet.)

I was wondering if there was any public functions written in C that I
could use to give the same functionality as in VC++?

Check up on strstreambuf and the manipulators oct, dec, and hex.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top