如何在C++中将"string*"转换为"const string&"?

Pau*_*cks 1 c++ pointers const reference

例如,如果我有以下内容:

void foo(string* s)
{
    bar(s); // this line fails to compile, invalid init. error
}

void bar(const string& cs)
{
    // stuff happens here
}
Run Code Online (Sandbox Code Playgroud)

我需要进行哪些转换才能让电话成功?