Hallo,
I am new to C++. I have only experience with C#.
I have the below problem:
in a loop i receive a buffer and I want so vae it (stream it??) to file. What is the best and fastest way to do it?
in pseudocode I would have something like
byte[920000] bb
open myfile for writing
loop
{
wait for bb to be ready
save timestamp to myfile
save buffer to myfile
}
close myfile
the size of the buffer is quite big, somwhere in between 900K and little bit more than 1 MB. the loop expects the buffer to be ready about 30/40 times per second.
@Little Bobby Tables: thx for spending time to read my post. Before ending up here I have goggled a lot. I could find many ways to save data to file but, if you had read carefully, you would have noticed I was asking for "the best" way. This requires a human brain to analyze the problem, apply knowledge, eventually propose a solution. I think search engines are not capable of doing that yet. Also, why should you reply "google it"? Do not have the answer? skip the post.
i did read your post carefully. what did you think i linked to? a bunch of robots generating code? of course it was "analysed" by humans. i really doubt you googled, because otherwise you would have found std::fstream, and i really doubt you would have found any other good solution, except perhaps a boost solution. i replied with google it, because, as should be common sense, forums arent meant for lazy posting. you should attempt to find your answer on google and then post it on a forum.