What you want to look into are variadic macros if you want a variadic number of parameters. Using those, you can define a macro like this
#define debug_print(...) <your code here>
in the <your code here>
section you can then use __VA_ARGS__
.
If you only want to use two parameters, you can define the macro like this:
#define debug_print(x, y) (std::cout << "value of x is::" << x << " " << "value of y is:::" << y << std::endl)
and use it like
int x = 5;
int y = 9;
debug_print(x, y);
As the others have already said, please do not use this macro unless you absolutely must! E.g. you don't see that debug_print
needs iostream
to work, and you don't see which types can be passed into it.