Test A;
Test A, *APtr = 0;
APtr = &A; // now APtr is pointing to memory location of A;
APtr = new Test(); //now you have allocated memory somewhere in your computer that can stores information for a Test object
Test A, *APtr = &A; //now APtr is pointer to the memory location of A
12345678910111213141516
#include <iostream> using namespace std; class test{ public: void print(){ cout << "Printing" << endl; } }; int main(){ test A,*Aptr = 0; A.print(); Aptr -> print(); return 0; }
Aptr -> print();