+ 2
I cant undetstand the meaning of pointers.. help me please
hi guys .. i can't understand meaning of pointers... where we can actually use it? what we need to know about pointers at all?
3 ответов
+ 7
When you store a value in a variable like this
int x = 5;
The value of x gets stored into the RAM. And every single area on ram where any value can be stored has a unique address, which helps system to locate where the exact value is stored onto the ram. Those addresses looks like bffd8b3c (i.e., in hexadecimal form).
Pointers are special kind of variables, which are specifically uses to store these addresses of any variable, as their value.
int *p = &x;
//p stores address of variable x which consists a value which is 5
WHERE YOU USE IT?
Arrays, are basically pointers.
Passing variables by reference to the functions.
Different data structures which uses pointers like LinkedLists (in c++).
You may learn many other uses of pointers, as time passes.
+ 3
thank you so much ...
- 1
qo qun@ chi tanum