Skip to content

Instantly share code, notes, and snippets.

@scottcarr
Created October 16, 2016 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottcarr/2dd025e969d5a1992b17e79cdbb3ffa9 to your computer and use it in GitHub Desktop.
Save scottcarr/2dd025e969d5a1992b17e79cdbb3ffa9 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
class Foo {
public:
ostream* std_out;
Foo() : std_out(&cerr) {
std_out->setf(ios::showpoint | ios::left);
}
void print() {
*std_out << 4.5f << endl;
}
};
Foo x;
int main() {
x.print();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment