-
as seen on Stack Overflow
- Search for 'Stack Overflow'
OK, before lecturing me on the use of C-style variadic functions in C++...everything else has turned out to require nothing short of rewriting the Qt MOC.
What I'd like to know is whether or not you can have a "slot" in a Qt object that takes an arbitrary amount/type of arguments. The thing is that…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
This is probably going to be a really simple explanation, but I'm going to give as much backstory as possible in case I'm wrong. Advanced apologies for being so verbose. I'm using gcc4.5, and I realize the c++0x support is still somewhat experimental, but I'm going to act on the assumption that…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Assuming it's possible, how would one pass arguments by reference to a variadic function without generating a warning in PHP? We can no longer use the '&' operator in a function call, otherwise I'd accept that (even though it would be error prone, should a coder forget it).
What inspired this…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I was wondering if in C/C++ language it is possible to pass arguments to function in key-value form.
For example in python you can do:
def some_function(arg0 = "default_value", arg1):
# (...)
value1 = "passed_value"
some_function(arg1 = value1)
So the alternative code in C could look like…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have functions that I wish to call based on some input. Each function has different number of arguments. In other words,
if (strcmp(str, "funcA") == 0) funcA(a, b, c);
else if (strcmp(str, "funcB") == 0) funcB(d);
else if (strcmp(str, "funcC") == 0) funcC(f, g);
This is a bit bulky and hard to…
>>> More