+ 1
Syntax explanation
Hi, I have this task In code playground. In this string : int(*f2)(int,int)=f1; As I understand we overload(or override? function) but how this syntax construct? What Standart It Is I’cant find It on cppreference.com ..? Task code: int f1(int a, int b){return a+b;} int f2(int a, int b){return a-b;} int main() { cout<<f2(2,2); int(*f2)(int,int)=f1; cout<<f2(2,2); f2=::f2; cout<<f2(2,2); return 0; }
1 Odpowiedź
+ 1
Function pointer !
Thank you👍🏽