title: what's different between StrCmpW and wcscmp?
body: <hr>
  
  <p>Actually i changed code to next.</p>
  
  <hr>
  
  <pre><code>struct myclass {
      bool operator() (std::wstring p1, std::wstring p2) {
          int result = 0;
          //// If character is alphabet, sorting need converse.
          wint_t a1 = p1.at(0);
          wint_t b2 = p2.at(0);
          int r1 = iswalpha(a1);
          int r2 = iswalpha(b2);
          **// return code of iswalpha.
          // 257 is Upper Alphabet, 
          // 258 is Lower Alphabet**
          if ((r1 == 257 &amp;&amp; r1 == 258) || 
              (r2 == 258 &amp;&amp; r2 == 257)) {
              result = p2.compare(p1);
          }
          else {
              result = p1.compare(p2);
          }   
  
          if (result != 0) {
              if (result == -1) {
                  return true;
              }
              else {
                  return false;
              }
          }
  
          return false;
      }
  } wStrCompare;
  
  void main() {
      std::vector&lt;std::wstring&gt; wlist;
      wlist.emplace_back(L"가나");
      wlist.emplace_back(L"123");
      wlist.emplace_back(L"abc");
      wlist.emplace_back(L"타파");
      wlist.emplace_back(L"하하");
      wlist.emplace_back(L"!@#$");
      wlist.emplace_back(L"一二三");
      wlist.emplace_back(L"好好");
      wlist.emplace_back(L"QWERID");
      wlist.emplace_back(L"ⓐⓑ");
      wlist.emplace_back(L"☆★");
      wlist.emplace_back(L"とばす");
  
      std::sort(wlist.begin(), wlist.end(), wStrCompare);
  }
  </code></pre>
  
  <hr>
  
  <h2>Test Result</h2>
  
  <pre><code>L"!@#$"
  L"123"
  L"abc"
  L"QWERID"
  L"ⓐⓑ"
  L"☆★"
  L"とばす"
  L"一二三"
  L"好好"
  L"가나"
  L"타파"
  L"하하"
  </code></pre>
  
  <hr>
  
  <p>is this good?
  Please give me a some opinion.</p>
  
  <p>Thanks!!</p>
  
  <hr>
  
  <h2>I change my code, but i still want to know "<em>is there difference between StrCmpW and wcscmp</em>" Please talk to me. thanks!</h2>
  
  <hr>
  
  <h2>Old question</h2>
  
  <p>I use qsort with std::wstring(for unicode string), and use StrCmpW.</p>
  
  <p>Previously, I used <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb759947(v=vs.85).aspx" rel="nofollow">StrCmpLogicalW</a>() with CString, <a href="https://msdn.microsoft.com/en-us/library/tddz3etf.aspx" rel="nofollow">CStringArray</a>.
  (These are depend on windows)</p>
  
  <p>But my code run in linux too, not only in windows.
  (CString is ATL(afx), StrCmpLogicalW() is in Shlwapi.h)</p>
  
  <p>So I use std::wstring and wcscmp, but result is different.</p>
  
  <p>Is there a difference between StrCmpW() and wcscmp()?</p>
  
  <h2>The Following is my code.(exactly not mine lol)</h2>
  
  <pre><code>int wCmpName(const void* p1, const void *p2)
  {
      std::wstring* wszName1 = ((std::wstring *)(p1));
      std::wstring* wszName2 = ((std::wstring *)(p2));
  
      int wret = StrCmpW(wszName1-&gt;c_str(), wszName2-&gt;c_str());
      // int wret = wcscmp(wszName1-&gt;c_str(), wszName2-&gt;c_str());
      // When i use wcscmp, different result comes out.
      return wret;
  }
  
  void wSort(std::vector&lt;std::wstring&gt; &amp;arr)
  {
      qsort(arr.data(), arr.size(), sizeof(std::wstring), wCmpName);
  }
  </code></pre>
  
  <hr>
  
  <p>Thanks!</p>
  
  <hr>
  
  <h2>Test Code</h2>
  
  <pre><code>void main() {
      std::vector&lt;std::wstring&gt; wlist;
      wlist.emplace_back(L"가나");
      wlist.emplace_back(L"123");
      wlist.emplace_back(L"abc");
      wlist.emplace_back(L"타파");
      wlist.emplace_back(L"하하");
      wlist.emplace_back(L"!@#$");
      wlist.emplace_back(L"一二三");
      wlist.emplace_back(L"好好");
      wlist.emplace_back(L"QWERID");
      wlist.emplace_back(L"ⓐⓑ");
      wlist.emplace_back(L"☆★");
      wlist.emplace_back(L"とばす");
  
      wSort(wlist);
  }
  </code></pre>
  
  <hr>
  
  <h2>Test Result</h2>
  
  <ul>
  <li><p>wcscmp</p>
  
  <pre><code>L"!@#$"
  L"123"
  L"QWERID"
  L"abc"
  L"ⓐⓑ"
  L"☆★"
  L"とばす"
  L"一二三"
  L"好好"
  L"가나"
  L"타파"
  L"하하"   
  </code></pre></li>
  <li><p>StrCmpW</p>
  
  <pre><code>L"!@#$"
  L"☆★"
  L"123"
  L"ⓐⓑ"
  L"abc"
  L"QWERID"
  L"とばす"
  L"가나"
  L"一二三"
  L"타파"
  L"하하"
  L"好好"
  </code></pre></li>
  </ul>
  
  <hr>
  
  <p>p.s : WHY limit reputation?! limited Images, limited URLs.
        Only text takes so long time.</p>