473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

When debug, I how to out put the name of the function.

For example, I have a function called test, I want to output the name
of the function. Is there any macro for it?

Peng

int test(){
....
cout << the name of the funcion

}
Jul 22 '05 #1
3 923
Peng Yu wrote:
For example, I have a function called test, I want to output the name
of the function. Is there any macro for it?

Peng

int test(){
...
cout << the name of the funcion
cout << "test()";

}

No, there is no macro in the language, although some compilers do provide
__PRETTY_FUNCTION__ or something of that sort.

V
Jul 22 '05 #2


Victor Bazarov wrote:
Peng Yu wrote:
For example, I have a function called test, I want to output the name
of the function. Is there any macro for it?

Peng

int test(){
...
cout << the name of the funcion


cout << "test()";

}


No, there is no macro in the language, although some compilers do provide
__PRETTY_FUNCTION__ or something of that sort.

V


I think there is a mechanism for this in C99 standard, is there any thought
about putting it in the next C++ standard as well?

Thanks,

David
Jul 22 '05 #3
David Lindauer wrote:
Victor Bazarov wrote:

Peng Yu wrote:
For example, I have a function called test, I want to output the name
of the function. Is there any macro for it?

Peng

int test(){
...
cout << the name of the funcion


cout << "test()";

}


No, there is no macro in the language, although some compilers do provide
__PRETTY_FUNCTION__ or something of that sort.

V

I think there is a mechanism for this in C99 standard, is there any thought
about putting it in the next C++ standard as well?


C99 has __func__, which has type 'const char[]'. There is a proposal
(n1650) that... [www.open-std.org is sooooo sloooooow today]... that...
probably mentions __func__, I have no patience to wait for that server
to send me back the article.

V
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Dan Perl | last post by:
Is there a mechanism or an idiom for adding code for debugging so that it can easily be removed in the production code? I am thinking of something similar to the C/C++ preprocessor statements with...
4
by: Jan | last post by:
I have a form with a large procedure in MS Access 2000. I had just added some more code and performed Compress and Repair when the following problem came up: When I try to open the procedue from...
10
by: Not Available | last post by:
On the host server: namespace JCart.Common public class JCartConfiguration : IConfigurationSectionHandler private static String dbConnectionString; public static String ConnectionString { get...
3
by: David Lozzi | last post by:
Howdy, I've discovered how to create and use a class in ASP.NET. However, when is the best time to use a class? For example, I am currently using session variables to store user information (user...
9
by: tshad | last post by:
This is from my previous post, but a different issue. I have the following Javascript routine that opens a popup page, but doesn't seem to work if called from an asp.net button. It seems to work...
0
by: Shawn Hogan | last post by:
I'm getting two different results when I call System.Reflection.Assembly.GetCallingAssembly when compiling in Release and debug modes. When i compile my application using the "Debug" configuration...
1
by: ncjed | last post by:
First off, my apologies if this topic has previously been covered. I am in the process of creating an A2K DB (Win XP) that will open other DBs (either on local drive, mapped drives, or UNC network...
41
by: z | last post by:
I use Visual C 2005 to develop my programs. One in particular is crashing in very specific and hard to replicate situations, made worse by the fact it only crashes when run -outside- the dev - as...
2
by: joelkeepup | last post by:
Hi, I made a change this morning and now im getting an error that says either "a is undefined or null" or "e is undefined or null" the microsoft ajax line is below, I have no idea how to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.