#include <iostream>
namespace A{
void print(){
std::cout<<"A::print() called"<<std::endl;
}
void run(){
std::cout<<"A::run() called"<<std::endl;
}
}
namespace B{
void print(){
std::cout<<"B::print() called"<<std::endl;
}
void run(){
std::cout<<"B::run() called"<<std::endl;
}
}
//-------------vvvvvvvvvvvvvvv-------->function2 has a parameter named print that is a pointer to a function taking no parameters and with return type of void
void function2(void (*print)()) {
print();
}
int main(){//void main() changed to int main()
function2(A::print);
function2(A::run);
function2(B::print);
function2(B::run);
}