Home Variable arguments inside a macro
Reply: 0

Variable arguments inside a macro

user383 Published in April 27, 2018, 6:41 am

I have two functions foo1(a,b) & foo2(a,b,c) and a macro

#define add(a,b) foo(a,b)

I need to re-define macro to accomplish,

1.if add() is called with 2 parameters, then call foo1

  1. if add() is called with 3 parameters then call foo2

Im new to the option VA_ARGS. How can I do that

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.312486 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO