#include <iostream>
void myFunction() {
std::cout << "Line number: " << __LINE__ << std::endl;
std::cout << "File name: " << __FILE__ << std::endl;
// 在C++98和C++03中
std::cout << "Function name: " << __FUNCTION__ << std::endl;
// 在C++11及以后版本中,可以考虑使用 __PRETTY_FUNCTION__
// std::cout << "Function signature: " << __PRETTY_FUNCTION__ << std::endl;
}
int main() {
myFunction();
return 0;
}