14 The default value of parameter in specified in 15 Passin
14. The default value of parameter in specified in ...?
15. Passing arguments by reference is declared using the symbol below:
Solution
Question 14:
the default value MUST be in the function prototype and not in the function implementation.
example :
int Add(int a, int b = 3);
so answer c is correct
Question 15:
Answer is : B
sample program :
#include <iostream>
using namespace std;
void changeI(int* i);
int main()
{
int i = 5;
cout << \"Before passing \" << i << endl;
changeI(&i);
cout << \"after passing \" << i << endl;
return 0;
}
// change i
void changeI(int* i)
{
*i = 34;
}
Output:
Before passing 5
after passing 34
