All pastes #432944 Raw Edit

Tick_Data Class

public cpp v1 · immutable
·published 2007-04-10 14:50 UTC
rendered paste body
#include <iostream>#include <vector>using namespace std;class A {public:        bool *var;void f (bool *var) { this->var = var;}void f2 () {   this->var = false;}};int main () {bool var = true;cout << var << endl;A obj;//pass a reference of var to function fobj.f(&var);//alter var using the function f2obj.f2();//output altered var, which unfortunately isn't altered :(cout << var << endl;return 0;}