Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
property get set
//g++ 5.4.0 #include <iostream> using namespace std; class Test{ int value; string name; public: Test(){} Test(int value, string name) :value(value), name(name){} // this->value = value // this->name = name void setName(string name){ this->name = name; // this->name != name } string getName(){ return name; // name == this->name } void setValue(int value){ this->value = value; // this->value != value } int getValue(){ return value; // value == this->value } }; int main() { Test test1; test1.setValue(123); cout<< test1.getValue() <<endl; // 123 Test test2(123,"abc"); cout<< test2.getValue() <<endl; // 123 test2.setValue(456); cout<< test2.getValue() <<endl; // 456 }
run
|
edit
|
history
|
help
0
QuickDoubly
Different Subarray Sum Problem
strcpy
Sorting Array
Widget Class with dynamic memory and pointers
SFML ANIMATOR
without HLD range Quey can be handled by just using segment tree on the FLATTENED TREE (euler tour)
5
no copy elision
bmp_lb