Resource- "C++ from the ground up" pg. 106 - Herbert Schildt
Ok…
int main()
{
int balance;
int *balptr;
int value;
balance = 3200;
balptr = &balance;
value = *balptr;
cout << "balance is: " << value << '\n';
return 0;
}
Ok. I get it. You access one variable indirectly through another variable.
Depending on the type of pointer, a certain amount of memory is set aside
Char 1 bit, int, float get 4 and double gets 8 bits… I get it.
int *p; (*p)++; // adds 4 because of memory allocation-- I get that too.
What I don’t get, is WHY is it so powerful? I could have just as easily assigned
value=balance;
Now, I realize I am new, and I’m just starting with pointers, just touching the surface. I also realize the c++ programmers reading this are probably rolling their eyes, and having a seizure at the thought of someone asking about the power of a pointer as you read this… Please forgive me… But in plain, simple 3rd grade english, can someone tell me please, what’s the big to do about pointers? I don't get the whole concept...

New Topic/Question
Reply
MultiQuote









|