ok, i want to do the following thing: a random number generator should save all the numbers it generates in a file. program2 should read the numbers in from this file and use them for example as coordinates. but to achieve this, should the random number generator save the numbers it generates directly in the file, or should i first wsprintf the numbers into strings, save them and then use something else in program2, to convert them back into "normal" numbers?

Posted on 2001-10-01 03:59:56 by NOP-erator
quite philosophic question ;)

ascii storage:
+ good to check for correctness
+ human read- and editable
+ system and cpu (bit-order) independent

binary storage:
+ faster to implement
+ runs faster
+ takes minimum storage
Posted on 2001-10-01 04:39:32 by beaster
so, when i store the numbers "binary" and read them into variables later in another program, i can use them as if they where normal numbers?
Posted on 2001-10-01 04:45:20 by NOP-erator

If the data you are generating with the random number generator is just an array of DWORDs, I would write them directly to memory and write it to disk.

On the other end, just read the file directly from disk to memory and its ready to use.

If you need to be able to edit the file, you would need to convert it both ways which will slow the operation down a lot.


Posted on 2001-10-01 06:23:33 by hutch--
thanks hutch!
Posted on 2001-10-01 07:14:52 by NOP-erator