Is it possible to create functions that are similar to scanf in the sense that I can use a format control string to determine how many variables the function will take in?

eg:
new_function(const char*, var1, var2, var3,...);

if so, can anyone point me in the direction of where to look for more information regarding this?
(Or can anyone tell me where I can sneak a peek at the scanf functions to see how they work...)