+3

Why this code gives an error when we assign the function "foo()" to a variable (i.e. let int p=foo() ;)?

https://code.sololearn.com/cTaLDjh5yxeo/?ref=app

4/12/2019 12:56:28 PM

Krishna Kumar

1 Answer

New Answer

+7

Because if you want to keep integer value returned by foo in p the declaration of foo must be: int foo()