rhillner : yes i know that now about initialising to a null value, but didnt at the time :P and i never said you couldnt access the value allocated to the memory address. i just said that by default the pointer point to a men=mory cell. you can then display the value of the variable allocated to that memory cell by doing what you did.
You explained the concept of pointers quite well, but you didn't explain the use of astreiks and the address caller. Other than that, it will be a good intro to someone who knows nothing about pointers. Good Job!
Pointers simply allow direct memory access. That is the basics. You can assign an address for a pointer to point to in anyway you want. for example.
int *ptr = (int*)100;
0121ryanh117 1 year ago
hey bro, do a search for camtasia, its the best screen recording program ive found, you can find a free download of it somewhere on the internet
duckie12791 3 years ago 2
Quite a few mistakes are in this video...
You should AlWAYS initialise a point = 0, otherwise it can overwrite other memory cells..
What you said at the beginning isn't true, you can access the data that the variable is pointing to:
int x = 4;
int *px = NULL;
px = &x;
cout << *px << endl;
Would output 4.
rhillner 3 years ago
rhillner : yes i know that now about initialising to a null value, but didnt at the time :P and i never said you couldnt access the value allocated to the memory address. i just said that by default the pointer point to a men=mory cell. you can then display the value of the variable allocated to that memory cell by doing what you did.
jrockpunk1 3 years ago
Comment removed
FOOFlGHTERS 1 year ago
You explained the concept of pointers quite well, but you didn't explain the use of astreiks and the address caller. Other than that, it will be a good intro to someone who knows nothing about pointers. Good Job!
jwtguy 3 years ago
jwtguy : thanks. and i know im not very good at explaining. i dint really explain the concept of dereferencing etc.
jrockpunk1 3 years ago
Better job than I could have done
jwtguy 3 years ago
lol i doubt it. but thanks :D
jrockpunk1 3 years ago