+ 1
I don't understand Pointers Could someone please explain it to me
I'm kind of a beginner to c++ so could you explain it easily
4 Respostas
+ 3
@Idun Blatant copy and paste of someone else's answer is not an answer.
+ 2
Pointers are the memory locations where a value is being stored. In most cases you would pass a a current value of a variable to a function to be handled. That function would then return some result to you which you might then put back into the original variable or do something else with it.
imagine you had a friend who knows how to do something. You want to tell him to do that thing once for all the people in line. The current count of people in line is stored in variable count. You can tell your friend to do his job 'count' times or you can tell your friend how to read 'count' and therefore know how many people are still in line on his own.
0
@Kevin Graham Can u provide a simple analogy on functions and why it's needed in c++ , I understand how to use it now but not sure why we need it in c++
- 3
Pointers are the memory locations where a value is being stored. In most cases you would pass a a current value of a variable to a function to be handled. That function would then return some result to you which you might then put back into the original variable or do something else with it.
imagine you had a friend who knows how to do something. You want to tell him to do that thing once for all the people in line. The current count of people in line is stored in variable count. You can tell your friend to do his job 'count' times or you can tell your friend how to read 'count' and therefore know how many people are still in line on his own.