I have problem understanding the main theory and concept of pointers. I have two question:
1)
pAge contains the address of Howold in the memory but why cannot I just use howold as variable like in the following code:Code:unsigned short int howOld = 50; // make a variable unsigned short int * pAge = &howOld; // make pointer to howOld
Does "yourAge" has the same value in the following code?Code:unsigned short int yourAge; //Code #1 yourAge = howOld;
If yourAge is same in both codes, then why dont I just use code#1 ?Code:unsigned short int yourAge; //Code #2 yourAge = *pAge;




Reply With Quote