title: Convert long to a CString in C++
body: <p>I am working with <strong>C++</strong> with <strong>Visual studio 2008</strong> IDE. I need to convert long to a CString (or some other format that will work well with CString). Once I have it converted, I need to concatenate it to another CString. Something like this (but open to suggestions):</p>
  
  <pre><code>CString = CString + convertToCString(long)
  </code></pre>
  
  <p><strong>Question 1:</strong> What is the <strong>best way</strong> (and please explain why an approach is superior over others) for the conversion?</p>
  
  <p>For now, I am using <strong>_ltow_s</strong>:</p>
  
  <pre><code>CString = CString + _ltow_s (long)
  </code></pre>
  
  <p>_ltow_s is returning WCHAR. So I end up with:</p>
  
  <pre><code>CString = CString + WCHAR
  </code></pre>
  
  <p><strong>Question 2:</strong> Is that concatenation safe and will yield the desired result? Is the concatenation of ‘<em>CString + WCHAR</em>’ results with a valid CString?</p>
  
  <p><strong>Question 3:</strong> If we are going down the rout of using _ltow_s, what is the buffer size that needed to be allocated? 32? also, is there a define for base 10 (decimal)?</p>
  
  <p><strong>Update:</strong>
  I found this thread: <a href="https://stackoverflow.com/questions/7531556/how-to-cast-a-long-to-a-cstring">How to cast a LONG to a CString?</a>
  I like it as it gives many options. What is still missing is what is the preferred way for different scenarios (within reason). Robustness, safety etc...</p>