C++ examples for Data Type:Pointer
Changes the value of a pointer variable.
#include <iostream> using namespace std; #include <iomanip> void main()/*from w w w. j a va2 s. c o m*/ { float v1=123.54; float v2=900.18; float * p_v; p_v = &v1; cout << "The first value is " << setprecision(2) << *p_v << "\n"; p_v = &v2; cout << "The second value is " << setprecision(2) << *p_v << "\n"; return; }