Defining class string constants in C++?
<p>I have seen code around with these two styles ,  I am not not sure if one is better than another (is it just a matter of style)? Do you have any recommendations of why you would choose one over another.</p>

<pre><code> //Example1
 class Test {

    private:
        static const char* const str;

};

const char* const Test::str = "mystr";

//Example2
class Test {

     private:
         static const std::string str;

};

const std::string Test::str ="mystr";
</code></pre>
