Passing Macro as a function argument.
Posted on 2004-08-08
Can someone please tell me if there is a way to use macro (SQL1) as listed in my example below be passed as an argument to a function. If yes, then can you please tell me the function prototype and function call syntax.
Here is the code:
#define SQL1 "select col1,col2 from table1" /* Sql statement */
int func(SQL1); /* function protoype */
func(SQL1); /*Call to func - passing SQL1 as argument */
printf(SQL1); /* Print SQL1 contents */