0
What is the difference?
what is the difference between this two options: int a = get_rand_number()//it returns number and int a = get_rand_number//also returns number Thanks for your helpđ
2 Answers
+ 3
If get_rand_number is declared a sa function,
get_rand_number would return a function pointer.
get_rand_number() would be a function call.
E.g.
void function() {
std::cout << "Function";
}
int main() {
void (*fptr)() = function;
fptr();
return 0;
}
0
I think there is a difference especially when using reference functionsđ€