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
BinTraversal v2
c++ car racing game
A number is prime or not
Faaaaak
mutable constexpr
MAC
Pairs having sum equal to target
stack::swap_30-Seconds-of-C++
Making pyramid using nested loop 2/2
MenuStream