Bah, pointers. I have come to the chapter in my book were I learn about pointers. I don't understand a single bit about em. Can someone help, and explain them? Thanks. Could you explain why this code works?
Code:
int main(int argc, char *argv[])
{
int intVar;
int* pintVar;
pintVar = &intVar;
*pintVar = 10;
cout << pintVar << " is pIntVar\n";
cout << intVar << "is intVar\n";
return 0;
}
All i get is pintVar as a hex and intVar as 10. I don't understand whats going on, how, and why. If anyone could help, that would be great. BTW, I"m using dev-c++