+ 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; }

19th Jun 2019, 4:26 PM
Chicherin Alexey
Chicherin Alexey - avatar
1 Answer
+ 1
Function pointer ! Thank youđŸ‘đŸœ
20th Jun 2019, 4:28 AM
Chicherin Alexey
Chicherin Alexey - avatar