For example,
void getPtr(int* ptr){
getPtr(ptr+5); //ok
}
void getRef(int& ref){
getRef(ref+5); //not ok
}
This is.
When implementing algorithms or data structures, we usually use pointers Other than that, I usually use references
© 2024 OneMinuteCode. All rights reserved.