As a C person, I'm attempting to comprehend some C++ code.
The declaration of my function is as follows:
int foo(const string &myname) {
cout << "called foo for: " << myname << endl;
return 0;
}
How does the function signature differ from the equivalent C:
int foo(const char *myname)
Is there a difference between using string *myname vs string &myname? What is the difference between & in C++ and * in C to indicate pointers?
Similarly:
const string &GetMethodName() { ... }
Why are the and here?
Is there a webpage that outlines the differences between how & is used in C and C++?