Language
C++
Compiler
gcc 13.2.0
Options
Warnings
Don't Use Boost
C++03
-pedantic-errors
#include <iostream>
void helper(void (*func)()) {
func(); // 関数の呼び出し
}
void test() { // 関数の宣言 (兼定義)
std::cout << "hello from test()!\n";
}
int main() {
helper(test);
return 0;
}
$ g++ prog.cc -Wall -Wextra -std=c++98 -pedantic-errors
hello from test()!
Exit Code:
0