c++ callback

include

void callBack(int x, int y) {
std::cout << "x:" << x << std::endl;
std::cout << "y:" << y << std::endl;
return;
}

void handle(int y, void (*callBack)(int, int)) {

callBack(y, y + 1);
return;

}

int main() {
handle(1, callBack);
return 0;
}

你可能感兴趣的:(c++ callback)