How to get function parameter names/values dynamically?

Is there a way to get the function parameter names of a function dynamically? Let’s say my function looks like this: function doSomething(param1, param2, …. paramN){ // fill an array with the parameter name and value // some other code } Now, how would I get a list of the parameter names and their values … Read more

Why does a function with no parameters (compared to the actual function definition) compile?

I’ve just come across someone’s C code that I’m confused as to why it is compiling. There are two points I don’t understand. The function prototype has no parameters compared to the actual function definition. The parameter in the function definition does not have a type. #include <stdio.h> int func(); int func(param) { return param; … Read more