+ 3

Pointers cpp

I dont Understand the pointers pleas explain it to me

18th Aug 2025, 2:45 PM
Ouladtahar Abdelkader
Ouladtahar Abdelkader - avatar
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.
18th Aug 2025, 4:21 PM
Aleksei Radchenkov
Aleksei Radchenkov - avatar
+ 1
Thanksssssss brothers
18th Aug 2025, 4:24 PM
Ouladtahar Abdelkader
Ouladtahar Abdelkader - avatar
0
Thanks bro for the clarifications No what are they used for
18th Aug 2025, 4:07 PM
Ouladtahar Abdelkader
Ouladtahar Abdelkader - avatar
0
pointers are variables storing the memory addresses of variables
20th Aug 2025, 12:37 PM
🏳️‍⚧️👑 ⚡️🌩️ War Goddess 300 ⚡️
🏳️‍⚧️👑 ⚡️🌩️ War Goddess 300 ⚡️ - avatar