Hi everyone! This is my first post. I hope I'm not saying things that go against this forum's way of thinking or violating any rule you may have. If I do, I'm sorry.
Here is the problem: I have to save hundreds of large files (about 3 MB each), each consisting of 1.5 millions integer numbers. I thought that a million and a half "fprintf"s was the slowest way and tried to create a large string containing all my data with:
for (i=0; i<imagewidth*imageheight; i++) /*they are images!*/
sprinft(bigstring, "%s%d ", bigstring, integernumber[i]);
but to my surprise this is much slower!!!!!
Is there a way to compose strings much faster than sprintf?
The same problem is when I open such files: is there anything faster than 1.5 millions of "fscanf"???
Another thing. I was thinking: if I give up a little bit of precision, I might use bytes instead of integer and save the image in bmp format or png format in black and white. But is there a library that allows me to do this?
I tried many already, but none of them worked. (p.e. ReadAndSavePng did'nt work)
The compilers I use are Borland Turbo C 2.01 on DOS and LabWindows CVI on Windows.
Thanks a lot to everyone who will answer.
By!