By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,227 Members | 1,290 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,227 IT Pros & Developers. It's quick & easy.

tracing function calls

P: n/a
hi,

i would like to trace the function that called the "current" function. i
need a type char name of that function. is that posibile?

eg.

void function()
{
char string[256];
GetCallerName(string);
printf(string);
}

void call()
{
function();
}

--
--------------------------------
Krešimir Špes
B.B. & Idol Graphics
http:// bb.gamer.hr
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
DigitalDragon wrote:
hi,

i would like to trace the function that called the "current" function.
i need a type char name of that function. is that posibile?


Not with standard C++.

Jul 19 '05 #2

P: n/a
There is a macro called __FUNCTION__ or __PRETTYFUNCTION__, but it is not
standard C++, I know for sure Visual C++ 6 does not implement it, but Visual
C++ 7, MW CodeWarrior and GCC does.. So when VC6 is phased out it will be
defacto standard i guess..

"DigitalDragon" <kr***********@zg.hinet.hr> wrote in message
news:bh**********@ls219.htnet.hr...
hi,

i would like to trace the function that called the "current" function. i
need a type char name of that function. is that posibile?

eg.

void function()
{
char string[256];
GetCallerName(string);
printf(string);
}

void call()
{
function();
}

--
--------------------------------
Krešimir Špes
B.B. & Idol Graphics
http:// bb.gamer.hr

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.