Click here to Skip to main content
16,020,666 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionGood code, wrong result Pin
Waldemar Ork4-Oct-09 4:56
Waldemar Ork4-Oct-09 4:56 
AnswerRe: Good code, wrong result Pin
Luc Pattyn4-Oct-09 5:25
sitebuilderLuc Pattyn4-Oct-09 5:25 
AnswerRe: Good code, wrong result Pin
Richard MacCutchan4-Oct-09 5:44
mveRichard MacCutchan4-Oct-09 5:44 
GeneralRe: Good code, wrong result Pin
Luc Pattyn4-Oct-09 6:08
sitebuilderLuc Pattyn4-Oct-09 6:08 
GeneralRe: Good code, wrong result Pin
Waldemar Ork4-Oct-09 7:40
Waldemar Ork4-Oct-09 7:40 
GeneralRe: Good code, wrong result Pin
Luc Pattyn4-Oct-09 8:39
sitebuilderLuc Pattyn4-Oct-09 8:39 
AnswerRe: Good code, wrong result Pin
David Crow5-Oct-09 4:56
David Crow5-Oct-09 4:56 
GeneralRe: Good code, wrong result Pin
Waldemar Ork5-Oct-09 23:29
Waldemar Ork5-Oct-09 23:29 
Unfortunately, You all are wrong. The number of combinations has nothing to do with GetNextCombination or "for" loop. The loop "do...while" is needed instead. Here's the code:
do {        
                  Total++;
                  cout << "Combination number. " << Total   << endl;
                  for (unsigned i = 0; i < combination.size(); i++)
                        {
                                                           
                        const Element &element = elements[combination[i]];
                        cout << element.name << ": " << element.chain << endl;
                       
                        }
               }
         while(cb.GetNextComb(combination));
Thank you and,
Take care!
QuestionC++ Helper Wanted Pin
MrMcIntyre4-Oct-09 3:48
MrMcIntyre4-Oct-09 3:48 
QuestionRe: C++ Helper Wanted Pin
Maximilien4-Oct-09 4:11
Maximilien4-Oct-09 4:11 
AnswerRe: C++ Helper Wanted Pin
MrMcIntyre4-Oct-09 4:20
MrMcIntyre4-Oct-09 4:20 
GeneralRe: C++ Helper Wanted Pin
Michael Schubert4-Oct-09 4:51
Michael Schubert4-Oct-09 4:51 
GeneralRe: C++ Helper Wanted Pin
MrMcIntyre4-Oct-09 4:54
MrMcIntyre4-Oct-09 4:54 
GeneralRe: C++ Helper Wanted Pin
Michael Schubert4-Oct-09 5:08
Michael Schubert4-Oct-09 5:08 
GeneralRe: C++ Helper Wanted Pin
MrMcIntyre4-Oct-09 5:14
MrMcIntyre4-Oct-09 5:14 
GeneralRe: C++ Helper Wanted Pin
Michael Schubert4-Oct-09 5:19
Michael Schubert4-Oct-09 5:19 
GeneralRe: C++ Helper Wanted Pin
MrMcIntyre4-Oct-09 5:23
MrMcIntyre4-Oct-09 5:23 
GeneralRe: C++ Helper Wanted Pin
Michael Schubert4-Oct-09 5:34
Michael Schubert4-Oct-09 5:34 
GeneralRe: C++ Helper Wanted Pin
MrMcIntyre4-Oct-09 5:39
MrMcIntyre4-Oct-09 5:39 
GeneralRe: C++ Helper Wanted Pin
Maximilien4-Oct-09 5:58
Maximilien4-Oct-09 5:58 
GeneralRe: C++ Helper Wanted Pin
MrMcIntyre4-Oct-09 6:09
MrMcIntyre4-Oct-09 6:09 
GeneralRe: C++ Helper Wanted Pin
MrMcIntyre4-Oct-09 7:11
MrMcIntyre4-Oct-09 7:11 
GeneralRe: C++ Helper Wanted Pin
MrMcIntyre4-Oct-09 7:19
MrMcIntyre4-Oct-09 7:19 
GeneralRe: C++ Helper Wanted [modified] Pin
Michael Schubert4-Oct-09 11:33
Michael Schubert4-Oct-09 11:33 
GeneralRe: C++ Helper Wanted Pin
MrMcIntyre4-Oct-09 11:51
MrMcIntyre4-Oct-09 11:51 

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.