c++ difference between std::string name and std::string &name
<p>I have a lib.h, lib.cpp and test.cpp. I would like to ask what is better?
lib.h</p>

<pre><code>class c
{
    std::string name;
}*cc;
</code></pre>

<p>lib.cpp</p>

<pre><code>{
    std::cout &lt;&lt; "the name is:" &lt;&lt; name &lt;&lt; std:: endl;
}
</code></pre>

<p>test.cpp</p>

<pre><code>main()
{ 
    c tst;
    tst.name="diana";
}
</code></pre>

<p>What should I use? std::string name or std::string *name? How can i work with &amp;name, how will my code change and which one of these 2 methods is the best one? </p>
