Hello, I would just like someone to help clarify some basic pointer syntax, and hopefully this post may be of use to some others also.
Any comments would be much appreciated! Thanks.Code:#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; int main(int nNumberofArgs, char* pszArgs[]) { int nVar = 37; int* pnVar = &nVar; // the adress of the pointer // (where the pointer exists in memory) cout << &pnVar << endl; // the value contained in // the variable pointed to (nVar) cout << *pnVar << endl; // the address of the where the variable (nVar) // exists in memory cout << pnVar << endl; system("PAUSE"); return 0; }



LinkBack URL
About LinkBacks


