title: SScanf for CString not working?
body: <p>I just want to split this string by the char ":"
  for example "first:last"
  so one string will have "first" and the other will have "last"</p>
  
  <p>I did like the one in this url (<a href="https://stackoverflow.com/questions/8642500/sscanf-string-splitting-not-working">sscanf string splitting not working</a>)
  but it didn't work well with me as both strings will have the "last" value</p>
  
  <pre><code> #define _CRT_SECURE_NO_WARNINGS  
   #include&lt;iostream&gt;
   #include &lt;cstring&gt;
   #include&lt;tchar.h&gt;
   #include&lt;atlstr.h&gt;
   using namespace std;
  
  
   void main()
  {
      CString firstString(""), secondString(""), myString("first:last");
  
      sscanf(myString, "%[^:]:%s", firstString, secondString);
  
      printf("first: %s, last: %s", firstString, secondString);
  
  
      system("pause");
  
  }
  </code></pre>