T
The Directive
I read the C FAQ question on passing a variable number of arguments,
but it didn't help. The example assumes all arguments are of the same
type.
I want to create a function "trace" that can be used like this:
trace( "Err", errtType, lineNum, NULL) /* where errType is char* and
lineNum is
an int */
trace("Err", lineNum, NULL);
trace( lineNum, "Err", funcName, NULL) /* where funName is char * */
The problem is that I don't know the order and the variable types of
the arguments passed.
How can I implement trace?
but it didn't help. The example assumes all arguments are of the same
type.
I want to create a function "trace" that can be used like this:
trace( "Err", errtType, lineNum, NULL) /* where errType is char* and
lineNum is
an int */
trace("Err", lineNum, NULL);
trace( lineNum, "Err", funcName, NULL) /* where funName is char * */
The problem is that I don't know the order and the variable types of
the arguments passed.
How can I implement trace?