Quote Originally Posted by christop View Post
I would even rewrite it to something like this which also limits the scope of output_file:

Code:
case 's':
    if (ofstream output_file(filename)) {
        .... some code ....
    }
    break;
case 'x':
    break;
You may need to use uniform initialisation syntax to get that to compile.