Click here to Skip to main content
15,911,139 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionwhat am I doing wrong? [modified] Pin
freakinn00b9-Aug-06 19:21
freakinn00b9-Aug-06 19:21 
AnswerRe: what am I doing wrong? Pin
sunit59-Aug-06 19:28
sunit59-Aug-06 19:28 
AnswerRe: what am I doing wrong? Pin
_AnsHUMAN_ 9-Aug-06 19:28
_AnsHUMAN_ 9-Aug-06 19:28 
AnswerRe: what am I doing wrong? Pin
ThatsAlok9-Aug-06 22:21
ThatsAlok9-Aug-06 22:21 
GeneralRe: what am I doing wrong? Pin
freakinn00b9-Aug-06 19:38
freakinn00b9-Aug-06 19:38 
GeneralRe: what am I doing wrong? Pin
sunit59-Aug-06 19:41
sunit59-Aug-06 19:41 
GeneralRe: what am I doing wrong? Pin
sunit59-Aug-06 19:46
sunit59-Aug-06 19:46 
GeneralRe: what am I doing wrong? Pin
_AnsHUMAN_ 9-Aug-06 19:51
_AnsHUMAN_ 9-Aug-06 19:51 
GeneralRe: what am I doing wrong? Pin
ThatsAlok9-Aug-06 22:24
ThatsAlok9-Aug-06 22:24 
GeneralRe: what am I doing wrong? Pin
Hamid_RT9-Aug-06 22:44
Hamid_RT9-Aug-06 22:44 
GeneralRe: what am I doing wrong? Pin
David Crow10-Aug-06 3:32
David Crow10-Aug-06 3:32 
AnswerRe: what am I doing wrong? Pin
Zac Howland10-Aug-06 4:30
Zac Howland10-Aug-06 4:30 
AnswerRe: what am I doing wrong? Pin
freakinn00b11-Aug-06 5:30
freakinn00b11-Aug-06 5:30 
Questionvariable type [modified] Pin
With_problem9-Aug-06 19:18
With_problem9-Aug-06 19:18 
AnswerRe: variable type Pin
_AnsHUMAN_ 9-Aug-06 19:24
_AnsHUMAN_ 9-Aug-06 19:24 
QuestionRe: variable type Pin
David Crow10-Aug-06 3:37
David Crow10-Aug-06 3:37 
Questionprint in list box Pin
With_problem9-Aug-06 18:22
With_problem9-Aug-06 18:22 
AnswerRe: print in list box Pin
_AnsHUMAN_ 9-Aug-06 18:37
_AnsHUMAN_ 9-Aug-06 18:37 
GeneralRe: print in list box Pin
With_problem9-Aug-06 19:10
With_problem9-Aug-06 19:10 
GeneralRe: print in list box Pin
_AnsHUMAN_ 9-Aug-06 19:22
_AnsHUMAN_ 9-Aug-06 19:22 
GeneralRe: print in list box Pin
With_problem9-Aug-06 20:25
With_problem9-Aug-06 20:25 
AnswerRe: print in list box [modified] Pin
Amar Sutar9-Aug-06 19:49
Amar Sutar9-Aug-06 19:49 
GeneralRe: print in list box [modified] Pin
With_problem9-Aug-06 20:26
With_problem9-Aug-06 20:26 
AnswerRe: print in list box Pin
Hamid_RT9-Aug-06 21:54
Hamid_RT9-Aug-06 21:54 
QuestionSTL headache Pin
Waldermort9-Aug-06 17:32
Waldermort9-Aug-06 17:32 
I have a list of 60 non-identical Chinese names (MBCS build). I am trying to create a routine that will count how many non-identical names there are. Simple I thought, use the STL set which is a unique list. Thing is, using those 60 Chinese names, the resulting set size is 58. It has discarded 2 names for no reason. OK, maybe a set is not up to the challenge, so I instead used the vector class. A vector of 60 names, sort() and unique() again becomes 58.

Unless anybody can point me in the right direction, I'm going to have to create something of my own.
// check for multiple students
std::vector< std::string > names(sheet->UsedRows() );
std::set< std::string > list;
short col = -1;
for (int i=0;i<sheet->UsedCols();i++) {
    if (head[i].type == NAME)
        col = head[i].column;
}
if (col == -1)
    return 0;
for (i=xRow;i<sheet->UsedRows();i++) {
    names[i] = sheet->Cell(col,i);
    list.insert( sheet->Cell(col,i) );
}
int sz = names.size();
sort(names.begin(),names.end() );
names.erase( unique(names.begin(),names.end() ),names.end() );
int foo = list.size();
int bar = names.size();

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.