main.cpp:15:5: error: no matching function for call to 'g' g(); ^ main.cpp:7:6: note: candidate function not viable: requires single argument 'i', but no arguments were provided void g(int i) { ^