When would you ever need to re-use a file stream?

Pages: 12
@dhayden: I did not see your post. Thanks, I hadn't considered that! What would you recommend as a good way to use RAII with file streams?
My life lately has been... challenging.

The FAQ is not dead, though it may seem to be. I just need to have some time I can spend on it regularly. I don't know how soon that will be again. (Not too long, I hope. It has been too long in coming already. The next piece I'll add, probably, is how to properly obtain random numbers.)

As for the tutorial, I have nothing to do with that. Our tutorial is, as I see it, not designed to do anything but cover C++ as a language.

As for variable declarations, I think that there is a misunderstanding going on here. Variables should be declared as close to their use as possible, but not scattered into the code. That is to say, a variable's scope should be properly associated with a statement block. And the variable's declaration belongs at the head of that block. It is self-documenting and more maintainable.

IMHO. Follow your company's style guides.
Topic archived. No new replies allowed.
Pages: 12