0

What is dereference????

23rd Apr 2017, 6:48 AM
rupali
5 Answers
+ 10
I do not know the dererefererencerece.
23rd Apr 2017, 6:49 AM
Ahri Fox
Ahri Fox - avatar
+ 9
@imabadkidz is right.
23rd Apr 2017, 7:34 AM
Agus Mei
Agus Mei - avatar
+ 9
I will never remove mine rip
23rd Apr 2017, 8:36 AM
Ahri Fox
Ahri Fox - avatar
+ 6
Wow, these are horrible responses. If you're not familiar with the language, you probably shouldn't try to answer questions about it. Kudos to imabadkidz for actually providing an answer. The dereference operator (*) is used to get the value associated with a pointer. For example, if I do int x = 5; int* ptr = &x; I can get the value of x from ptr by using the dereference operator before the variable: std::cout << *ptr << std::endl; // outputs 5 If I didn't use it, it would just output the memory address of x instead.
23rd Apr 2017, 7:39 AM
Squidy
Squidy - avatar