+ 3
Pointers cpp
I dont Understand the pointers pleas explain it to me
6 Risposte
+ 2
Ouladtahar Abdelkader in regards to what they are used for:
The most obvious one is arrays (including strings). Array is just a pointer to the first element, and indexing is pointer arithmetic. Simillarly if you are declaring arrays on heap, u would be using pointers.
It's also often used to pass into functions as additional return values (return values to variables). Speaking of functions, there are also function pointers (which point to functions). Function pointers is what's used in C to create OOP. In C++ though it still has other uses.
There are a lot of other less intuitive pointer applications though, like reversing strings and such.
+ 1
Thanksssssss brothers
0
Thanks bro for the clarifications
No what are they used for
0
pointers are variables storing the memory addresses of variables