+ 3
What the role of pointer in c++and c?
3 Respuestas
+ 2
Another useful case for pointers is when passing around pointer references to big data structures. You don't want to pass big structs to functions by value which are implicitly copied, because that is slow and can blow up the stack.
Instead you pass the pointer around which holds the address of the structure, which is very useful. Except in C++ you'd probably use a reference '&' and not a pointer.
+ 1
pointers are very useful as they are the variables which can store the other variables(address).Simply,they can point or store the adresses of functions,arrays,strings,another variable.so,all you have to do is u can assign them to whichever variable u want.They actually make coding feasible and easy.
+ 1
Pointer is a special variable which holds the address of another variable ,so that it can point to the particular address during the execution, which makes the program more comfortable to perform.
We use indirection operator('&') with pointers.
Every pointer occupies 4 bytes of memory irrespective of its datatypes.