Answer by Pointer for How to know last argument of va_list?
Another ugly way for both int and strings:#include <stdio.h>#include <stdarg.h>#define print(...) fnprint("{" # __VA_ARGS__ )fnprint(char *b) { int count = 0, i; if (b[1] != '\0') { for (i...
View ArticleAnswer by David Ranieri for How to know last argument of va_list?
You can take a look to NARGS macroAdapted to your code:#include <stdio.h>#include <stdarg.h>#define NARGS_SEQ(_1,_2,_3,_4,_5,_6,_7,_8,_9,N,...) N#define NARGS(...) NARGS_SEQ(__VA_ARGS__, 9,...
View ArticleAnswer by Some programmer dude for How to know last argument of va_list?
There is no way of knowing how many arguments are passed from inside a variable-argument function, that's why functions such as printf are using special format strings that tells the function how many...
View ArticleHow to know last argument of va_list?
I'm reading about how to pass optional arguments to function. But I'm unable to understand those. When I see examples, they are confusing and a bit complex. So I just started with a very simple program...
View Article
More Pages to Explore .....