#include // #txt is forced to be a double quoted string literal #define ERR(txt) std::cerr << __FILE__ << "." << __LINE__ << ": " << #txt << std::endl int main(int argc, char** argv) { std::cout << "Hello World" << std::endl; ERR(error here); std::cout << "Hello World" << std::endl; return 0; }