Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Default copy
#include <iostream> using namespace std; class Foo{ public: int bar, *baz; Foo(int x): bar(x){ baz = new int; *baz = 2; } }; int main(){ Foo x(5); Foo y(6); y = x; //bar and baz copied cout << "Before baz edit:" << endl; cout << x.bar << ' ' << y.bar << endl; cout << *x.baz << ' ' << *y.baz << endl; *x.baz = 0; //only x was changed cout << "After edit:" << endl; cout << x.bar << ' ' << y.bar << endl; cout << *x.baz << ' ' << *y.baz << endl; }
run
|
edit
|
history
|
help
0
Finalproject
Correlation Coefficient
Binary search on sorted array
Segmented Sieve
/
12535
kroliki
c++
cppOverride
MyStack