Seems that what you are looking for is a function that accepts a variable number of parameters. This can be accomplished with the use of va_start and other related macros.
For a sample function that uses them you can look at
this postYou can find some discussion about the va_xx macrosin these links:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_va_arg.2c_.va_end.2c_.va_start.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_crt_va_arg.2c_.va_end.2c_.va_start.asp