Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
function pointer
//clang 3.8.0 #include <iostream> int mult(int a,int b){ return a*b; } int sub(int a,int b){ return a-b; } int operation(int c,int d,int (*func)(int,int)){ int t; t=(*func)(c,d); return t; } int main() { int q,w; int (*multiply)(int,int)=mult; q=operation(10,2,multiply); w=operation(21,q,sub); std::cout <<w; }
run
|
edit
|
history
|
help
0
mine
BinaryGap, C++ - Find longest sequence of zeros in binary representation of an integer.
GetTypeName
SimpleList Example
Store Information in Structure and Display it
Throttle Example (Send two requests every two seconds)
ternary test c++14
non-template template parameters for container stream insertion: SFINAE
numeric_limits
selection sort