Question: With respect to the following code snippet, void Foo ( int * & ip ) { / * do something * / } int main

With respect to the following code snippet,
void Foo(int*& ip){
/* do something */
}
int main(){
int* pt = new int(7);
Foo(pt);
}
which of the following statement is correct?
ip and pt are names bound to the same pointer object. Therefore, the programmer can assign a value (i.e., address) to that pointer object through either name.
ip and pt are two distinct pointer objects. Therefore, incrementing the value stored in one is not reflected in the value stored in the other.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!