)How can the function abcfunc change the contents of intpoint, and have that change seen by the calling program?

a)Recode abcfunc and pick up the parameter by reference

b)Change it using the * operand

c)Change it by dereferencing and using the & operand

d)Use static_cast to change its type

Respuesta :

Answer:

b)Change it using the * operand.

Explanation:

When the function wants to cahnge the value of a pointer  variable it can do that by usnig the * operator.It is also called the dereferncing operator.

For example:-

#include <iostream>

using namespace std;

void abc(int *a)

{

   *a=50;

   cout<<*a<<endl;

}

int main() {

   int a=10;

   int* p=&a;

   cout<<*p<<endl;

   abc(p);

   cout<<*p;

return 0;

}

Output:-

10

50

50

First the value of the pointer which it points to was 10.Then in the function we changed it to 50 using * operator and printed it in the function.The again printing the value of pointer p using * operator.The value is 50.

Ehnce the answer is option b.