Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Assigment operator (easy)
#include <iostream> class Base { int a; public: Base(int Value):a(Value){;} Base():a(0){;} int Get(){return a;} Base& operator=(const Base &Obj) { a = Obj.a; return *this; } }; int main() { Base A(8); Base B(2); std::cout<<"A: "<<A.Get()<<'\n'; std::cout<<"B: "<<B.Get()<<'\n'; std::cout<<"B = A;\n"; B = A; std::cout<<"A: "<<A.Get()<<'\n'; std::cout<<"B: "<<B.Get()<<'\n'; }
run
|
edit
|
history
|
help
0
static_cast makes a copy
Sequence point and array
queueLinkedlist
Dij. Algo
Calc
Temp
Sortowanie przez scalanie
DailyGroceryHisto
PrePostIncrOp
Rrrrrrrr