Click here to Skip to main content
16,016,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: To Convert from CString to Char array ? Pin
KarstenK6-May-02 4:12
mveKarstenK6-May-02 4:12 
GeneralOne more CListBox question Pin
tordyvel5-May-02 9:34
tordyvel5-May-02 9:34 
GeneralRe: One more CListBox question Pin
Jack Handy5-May-02 10:29
Jack Handy5-May-02 10:29 
GeneralRe: One more CListBox question Pin
tordyvel5-May-02 10:30
tordyvel5-May-02 10:30 
GeneralSort help with Visual C++ Pin
Learning5-May-02 9:24
Learning5-May-02 9:24 
GeneralRe: Sort help with Visual C++ Pin
Joaquín M López Muñoz5-May-02 9:39
Joaquín M López Muñoz5-May-02 9:39 
GeneralRe: Sort help with Visual C++ Pin
Learning5-May-02 10:29
Learning5-May-02 10:29 
GeneralRe: Sort help with Visual C++ Pin
Joaquín M López Muñoz5-May-02 11:04
Joaquín M López Muñoz5-May-02 11:04 
This can be done, but involves a little more work. Here's an outline of the method:
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
...
// split into words and store them in a vector.
std::vector<std::string> v;
std::istringstream istr((LPCSTR)m_strEnterData);
for(;;){
  std::string s;
  istr>>s;
  if(s.empty())break;
  v.push_back(s);
}
// sort the words
std::sort(v.begin(),v.end());
// output the result to m_strDisplayResult
m_strDisplayResult="";
for(std::vector<std::string>::const_iterator it=v.begin();
    it!=v.end();
    ++it){
  if(it!=v.begin())m_strDisplayResult+=" ";
  m_strDisplayResult+=it->c_str();
}
(Sort of, I haven't compiled this.)

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralRe: Sort help with Visual C++ Pin
Learning5-May-02 11:42
Learning5-May-02 11:42 
GeneralRe: Sort help with Visual C++ Pin
Joaquín M López Muñoz5-May-02 12:00
Joaquín M López Muñoz5-May-02 12:00 
GeneralJoaquín, Thank you...EOM Pin
Learning6-May-02 1:46
Learning6-May-02 1:46 
GeneralCListBox Pin
tordyvel5-May-02 9:00
tordyvel5-May-02 9:00 
GeneralRe: CListBox Pin
alex.barylski5-May-02 9:12
alex.barylski5-May-02 9:12 
GeneralRe: CListBox Pin
tordyvel5-May-02 9:15
tordyvel5-May-02 9:15 
GeneralRe: CListBox Pin
Nish Nishant5-May-02 9:19
sitebuilderNish Nishant5-May-02 9:19 
GeneralCRC64 / CRC128 / CRC256 ... Pin
Dominik Reichl5-May-02 8:53
Dominik Reichl5-May-02 8:53 
GeneralCButton & Messages Pin
5-May-02 7:31
suss5-May-02 7:31 
GeneralRe: CButton & Messages Pin
Shog95-May-02 7:48
sitebuilderShog95-May-02 7:48 
GeneralRe: CButton & Messages Pin
5-May-02 8:03
suss5-May-02 8:03 
GeneralRe: CButton & Messages Pin
5-May-02 8:18
suss5-May-02 8:18 
GeneralRe: CButton & Messages Pin
5-May-02 8:35
suss5-May-02 8:35 
GeneralRe: CButton & Messages Pin
Shog95-May-02 8:58
sitebuilderShog95-May-02 8:58 
GeneralRe: CButton & Messages Pin
5-May-02 9:52
suss5-May-02 9:52 
GeneralRe: CButton & Messages Pin
Michael Dunn5-May-02 7:57
sitebuilderMichael Dunn5-May-02 7:57 
GeneralReleaseDC is not working Pin
MaTrIX2k25-May-02 7:14
MaTrIX2k25-May-02 7:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.