How to call jQuery function with multiple parameters?

Is there a way to extract the function name and parameters (both values and types) of a C++ function?

  • What I would like to do is, for a function defined as: LONG Try_Function (int ID, DWORD dID, LPVOID lpParams) { //Do or call something here that returns function name (Try_Function), //all parameters, their values as passed in, and if possible, their types } Edit: I know that VS supports the __FUNCTION__ macro which will give me the function name. Any tips on how to extract the parameters, with types?

  • Answer:

    Read about lex

Nagasuri Bala Venkateswarlu at Quora Visit the source

Was this solution helpful to you?

Other answers

You can use the __func__ magic word to get the name of the function (some compilers may support different variants, like __PRETTY_FUNCTION__ in g++). I can't think of a way to dump all the arguments without specifying them explicitly. If you're willing to change the function's signature, you may be able to do something clever using variadic templates or variadic arguments.

Jelle Zijlstra

There is no standard way, although for compatibility's sake __FUNCTION__ is supported by both VS and gcc. But please keep in mind that it's a compiler extension.

Dorin Lazăr

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.