PracticeDev/study_cpp/cpp_primer_source_code/Chapter 4/init_ptr.cpp

16 lines
382 B
C++
Raw Permalink Normal View History

2022-12-20 17:31:11 +08:00
// init_ptr.cpp -- initialize a pointer
#include <iostream>
int main()
{
using namespace std;
int higgens = 5;
int * pt = &higgens;
cout << "Value of higgens = " << higgens
<< "; Address of higgens = " << &higgens << endl;
cout << "Value of *pt = " << *pt
<< "; Value of pt = " << pt << endl;
// cin.get();
return 0;
}