How to call a function without using function name to send parameters?
PJRStudies:
in which language?
Answers
Answered by
0
In which language? in c: func().
in java: func() . in definition, do this:
int func()
insetead of int func(int x)
(int can be anything)
(func is a name)
Answered by
0
Answer:
By using function pointers
Explanation:
function pointer is a pointer that points to the function or rather the executable code. Pointer stores the the address of the function.
like here *fun_ptr is a pointer
void (*fun_ptr)(int) = &fun;
Invoking fun() using fun_ptr
(*fun_ptr)(10);
you can send parameters without using name of the function
Similar questions