Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
primes
C++ Solar eclipse program(Shoushi integrated) 1644 - 1785 from Ideone( Date: August 14, 2014 )
maximize the difference
Finding Ocean
Test1
as
PRIx64 on gcc
multimap
shell sort
Some-stuff
Please log in to post a comment.