Re: Quizz question : what is the equivalent of Delpi "Currency" in pureC ?

2007-10-25 03:33:58 PM
Regarding all those answers, here's what I want to do :
A Delphi program (1) that creates a "stream", connect to a TCP server
written in C (2) and sends this stream.
This stream is composed of different fields, including utf-8 encoded strings
(see my other posts) and currency fields.
Currency fields are the only problem left.
I want the stream to be as compact as possible.
Thus I make a binary stream of each element written directly ie for a
Cardinal named Cd, I write the 4 bytes Cd takes in memory.
But this doesn't fit my needs because I am writing under Windows and I want a
full portable C program.
Thus I found out this morning that the best solution would be to write it as
a string... it just takes much more space. So I am going to compress it
before sending. Zlib is avalaible both in Delphi (Zip) and Zlib in C and
I've managed to compress in Delphi and to uncompress the result in C, so
that shouldn't be a problem anymore...
My project is getting closer to the first release...