Using macro definition vs const variable : <p>I have few questions about pre-processor macros. Here is an example of 2 different code pieces to talk about;</p>

<pre><code>tmp.h
#define DEFAULT_STRING "default_value"

tmp.cpp
void tmpFunc(std::string newValue){
    m_stringValue = newValue;
    if(newValue.isEmpty())
        newValue = DEFAULT_STRING; 
}
</code></pre>

<p>And the second version </p>

<pre><code>tmp.h
const std::string m_defaultValue = "default_value"

tmp.cpp
void tmpFunc(std::string newValue){
    m_stringValue = newValue;
    if(newValue.isEmpty())
        newValue = m_defaultValue; 
}
</code></pre>

<p>So my questions are;</p>

<ul>
<li>Does the first version increase the binary size (comparing the first second)?</li>
<li>Does the second version consume more memory (comparing the first one)?</li>
<li>What are the performance impacts of both implementations? Which should run faster and why?</li>
<li>Which is preferable/beneficial in which condition?</li>
<li>Is there any better way for implementation of setting the default value?</li>
</ul>

<p>Thanks.</p>
