Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
static property
//g++ 5.4.0 #include <iostream> using std::cout ; struct Math{ static double Pi; static int pow(int base, int n); }; double Math::Pi = 3.1415926; int Math::pow(int b, int n){ int ans = 1; while(n--){ ans *= b; } return ans; } int main() { int r = 10; cout<< Math::pow(r,2) * Math::Pi; return 0; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Test 17(2021)
PreDir2
123
test
11aa11
DeepaC++
adjacent_difference-30-Seconds-Of-CPP
Flowchart segitiga
Precendence of Pointer Indirection Example
GCC compiler bug (should output 0 1)
Please log in to post a comment.