dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


advertisement
 

Retrieve a Function's Name Programmatically

Embedding a hard-coded string inside a function's body in order to retrieve that function's name can be tedious and bug-prone. Learn how to use a new C99 facility to obtain the function's name at runtime.


advertisement

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


bject reflection libraries, debugging tools, and code analyzers often need to access functions' names at runtime. Until not long ago, the only portable way to accomplish this was to manually embed a hard-coded string with the function's name inside the function's body. Needless to say, this technique is very tedious and bug-prone. This article demonstrates how to use a new C99 facility to obtain a function's name at runtime.


How can you access the name of a currently executing function programmatically?


Use the __FUNCTION__ facility and its related macros.



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date