Variable arguments in C, how to get values with a generic type?
问题 I'm trying to use C stdarg.h lib, with a generic type. The type int, is my generic type > to understand it, please, hold reading. So, my problem is: I have a function that accept variable number of arguments. like void function (int paramN, ...); In my program, there are no way to know, which is the type of variable arguments, it can be a char, an array, an int, an short, an function point, etc... like function (paramN, "Hey, I'm a string", 1, function_pint, array, -1); // -1 is a sentinel.