You really don't need to use sheep file and the fun version... the C standard library does it for you 'under the hood'. See http://linux.die.net/man/3/flockfile
Another problem is that you are trying to mix C++ and C I/O. A C++ std::iostream is not a C FILE*. The f[un]lockfile() functions only work on a FILE*.
Also, the f[un]lockfile() functions are for handling multiple threads in file accesses... Are you sure you aren't trying to open your file in exclusive access mode instead?
I am learning c++ Duoas.And trying myself.I didn't open this hood in article or lounge section.This section's name beginner.What is the mean beginner?Ok?Thank u for help.
I am aware of that and have given you a very kind answer, complete with links to the answer to your question. I've also been kind enough to recognize that you are probably using the wrong function for what you want to do, and I've asked for more information in order to help you better.
But if you are going to become rude then get lost.
http://www.cplusplus.com/forum/beginner/37099/
Remember this.I know.I said thank u.I am not a thankless man.But u said:You really don't need to use sheep file and the fun version.Where are u know need or don't need?I asked u.Yes.I don't need this codes.But i want to this language.So i must try myself.I accepted i am a beginner programmer.But sheep,fun and kind words to impropered to say.I feel have been u are a good man.But if u are a going to become scathing man then get lost Duoas.
But sheep,fun and kind words to impropered to say.
I've said nothing improper to you, but I refuse to be abused after kindly offering free help. BTW, the part about sheep is called humor, as in "a flock of sheep in a file". Good luck playing with the big boys when you assume you know as much as they do...