#### Archived

This topic is now archived and is closed to further replies.

# paramenter . . . .

This topic is 5587 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I was wondering how i can create functions that use the ... as a paramenter _ like vMyFunc(char *szName, ...); like sprintf/printf (and the rest of that lot )

##### Share on other sites
Try this:

  #include <stdarg.h>void vMyFunc(char *fmt,...){va_list args;char text[1024];va_start(args,fmt);vsprintf(text,fmt,args);va_end(args);// do something with text}

You can do other stuff with va_lists. Take a look at your compiler help files/man pages.

• 9
• 9
• 13
• 41
• 15