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 Antworten
+ 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🤔