Hi,
I use zlib to write data structures to a compressed file, using the
gzwrite function. Afterwards I read the data back with gzread. I notice
that this works well when the data written is not that much, but when
there is more data to write, after a while I get data errors when
reading back the data.
Error in main: couldn't read stat
zlib error -3: test512-20070531-18h10m02.stat.g z: data...
User Profile
Collapse
-
Problems using zlib - buffer problem or something else?
-
Hi,
Here is a site that explains function pointers for both in C and C++, which I found very helpful:
http://www.newty.de/fpt/index.html
Thomas... -
I'm on Linux, I thought that writing as binary or text was the same (i.e. the 'b' option is ignored). From the manpage:
What do you mean with the last sentence? I thought snprintf will check for the buffer overrun, right?
When I don't use memset, I have to make sure that I pass the correct length arguments to fwrite, right? Is it ok to give the size argument to fwrite a value of...Leave a comment:
-
patrickdepinguin replied to i want to create a program that translates a sentance in english to another languagein CThis one doesn't use trees, but nevertheless seems of use:
http://www.boost.org/libs/iostreams/doc/tutorial/dictionary_filt ers.html
It is from a library called boost, the source code should be downloadable.
I didn't find a complete tree solution immediately, but you can find examples on searching in trees separately. You can then uses these in your own script....Leave a comment:
-
patrickdepinguin replied to i want to create a program that translates a sentance in english to another languagein CJust my 2 cents, but using a simple text file to handle this problem is very inefficient. Furthermore, such a dictionary problem has undoubtedly been solved before and if you want a good result (and don't necessarily want to do it yourself) you can look on the internet for an appropriate solution which is free to use.
A more efficient way to store the dictionary would be to use some kind of tree structure (simple tree, btree, balanced...Leave a comment:
-
[c] Efficiently writing large quantities of data to a file
Hi,
I need to write large quantities of data to a file in C. The data comes from statistics that are continuously gathered from a simulator, and in order to not slow the whole thing down I would obviously want the writes to go as fast and efficient as possible.
Since I/O operations are rather slow, I was thinking that using a large buffer would be better than writing each data point every time. Each data point calls...
No activity results to display
Show More
Leave a comment: