Analyse the code

Analyse the code snippet given below and choose the correct option.

void funtion1(int (*)(int)) {}
void function2(char (*)(int)) {}
void function3(int (*)(int)) {} // #1
void function3(char (*)(int)) {} // #2
auto samplelambda = [](auto a) { return a; };
function1(samplelambda); // Line1
function2(samplelambda); // Line2
function3(samplelambda); // Line3
Options
  1. Line 2 and Line 3 will throw an error
  2. Only Line 2 will throw an error
  3. Only Line 3 will throw an error
  4. Only Line 1 and Line 3 will throw an error

Related Posts

Close Bitnami banner
Bitnami