fork download
#include <iostream>
using namespace std;

class Test {
        public:
                int a;
                Test () : a(0) {}
};
 
class Lol {
        public:
                int a;
                Lol () : a(0) {}
};
 
void fun (Test * test)
{
        cout << "obiekt wew fun przed operatorem = " << test->a << endl;
        test->a = 3;
        cout << "obiekt wew fun po operatorze = " << test->a << endl;
}
 
int main()
{
        Lol obiekt;
        obiekt.a = 9;
        cout << "obiekt przed fun: " << obiekt.a << endl;
        fun((Test*)(void*)&obiekt);
        cout << "obiekt po fun: " << obiekt.a << endl;
        cin.get();
        return 0;
}
Success #stdin #stdout 0s 2856KB
stdin
Standard input is empty
stdout
obiekt przed fun: 9
obiekt wew fun przed operatorem = 9
obiekt wew fun po operatorze = 3
obiekt po fun: 3