hello guys.
i want to func2 could determine that which function has been called it.as i explain in comment in func2 in the below. any help would be appreciated
Code:#include <iostream> using namespace std; void func2(void) { //how can i get the function name that call func2 //and also the line that func2 called in that //and imagine there is more than one file in my project //then how can i find which file and line and function called //func2 . the real question is i can not complete func2 // in a way that could figure out what function call this function } int func1(int a, int b) { if(a>b) func2(); else cout << "a+b = " << a+b; } void func3(void) { func2(); }