Quantcast
Channel: How to know last argument of va_list? - Stack Overflow
Browsing latest articles
Browse All 4 View Live

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 Article



Answer 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 Article

Answer 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 Article

How 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
Browsing latest articles
Browse All 4 View Live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>