Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
cast operator
//Title of this code #include <iostream> using namespace std; class A { int a,b; public: A(int a, int b) { this->a = a; this->b = b; } explicit operator int () const { return a + b; } }; int main() { cout << "Hello, world!\n"; A a(3, 4); int c = int(a); cout << c << endl; }
run
|
edit
|
history
|
help
0
Defining Class Members
Stock buy/sell, maximum subarray problem
spiral traversal of a matrix
topological sort
Silly circular pointer
cache 内存消耗
abraham
PointClassOpLoad
find-missing-number-arithmetic-progression
ListCPP