Share
Explore BrainMass

C++

Program that does the following:

delcale an integer (var1)
declare a pointer (ptr1) that points to var1
declare a reference (ref1) to var1
assign the address of var1 to ptr1
print the value of var1 using the pointer
use the ref1 to change the value of var1 to var15
print the value of var1 using the ref1

Solution Preview

Please see the attached file.

//delcale an integer (var1)
int var1 = 1;

//declare a pointer (ptr1) that points ...

Solution Summary

It provides sample codes to realize the desired functions.

$2.19