When declaring a function, what is the difference between the parameters string* and string&? I know that string s would make a copy of the string s and pass it by value, but it seems that on many websites, they refer to string* s and string& s as both passing by reference. I am new to C++ and this is the only thing that i have not been able to figure out myself. Thanks in advance 🙂
When declaring a function, what is the difference between the parameters string* and string&
Share
Decent explanation here:
http://www.cprogramming.com/tutorial/references.html
(Hint: there is more to it than “it looks different”)