Click here to Skip to main content
15,917,645 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Document/View question Pin
7stud16-Aug-03 8:51
7stud16-Aug-03 8:51 
GeneralRe: Document/View question Pin
John R. Shaw16-Aug-03 10:05
John R. Shaw16-Aug-03 10:05 
GeneralRe: Document/View question Pin
7stud16-Aug-03 20:19
7stud16-Aug-03 20:19 
GeneralRe: Document/View question Pin
Bob Stanneveld17-Aug-03 5:15
Bob Stanneveld17-Aug-03 5:15 
Generalhooking Pin
kafchan200316-Aug-03 0:19
kafchan200316-Aug-03 0:19 
GeneralRe: hooking Pin
Alexander M.,16-Aug-03 14:47
Alexander M.,16-Aug-03 14:47 
GeneralRe: hooking Pin
kafchan200318-Aug-03 0:27
kafchan200318-Aug-03 0:27 
Generalvectors. Pin
WREY15-Aug-03 23:30
WREY15-Aug-03 23:30 
There is this vector of string that has duplicates in it. I am trying to build a second vector of string to hold the non-duplicates.

The program crashes with the following code.

('iterB' and 'iterE' are already defined as iterators of the first vector.)

iterB = Sym.begin();  // begin of vector with duplicates
iterE = Sym.end();    // end of vector with duplicates


vector<string>::iterator iterNonDup_B;   // non-duplicate begin
vector<string>::iterator iterNonDup_E;   // non-duplicate end
		
for(; iterB!=iterE; ++iterB)
{
   if(nonDupSym.empty())
   {
      nonDupSym.push_back(*iterB);
      nonDupCnt++;
   }
   else
       for(; iterNonDup_B!=iterNonDup_E; ++iterNonDup_B)
       {
           if(*iterB==*iterNonDup_B)   // duplicate found
                dupCnt++;
           else
           {
               nonDupSym.push_back(*iterB);
               nonDupCnt++;
            }
        }
			
   iterNonDup_B = nonDupSym.begin();
   iterNonDup_E = nonDupSym.end();
}

Any help in pointing out flaw(s) would be greatly appreciated.

Thanks!

Smile | :)

William

Fortes in fide et opere!
GeneralRe: vectors. Pin
Neville Franks15-Aug-03 23:42
Neville Franks15-Aug-03 23:42 
GeneralRe: vectors. Pin
Anonymous16-Aug-03 4:30
Anonymous16-Aug-03 4:30 
GeneralRe: vectors. Pin
markkuk16-Aug-03 6:29
markkuk16-Aug-03 6:29 
GeneralRe: vectors. Pin
ZoogieZork16-Aug-03 6:32
ZoogieZork16-Aug-03 6:32 
GeneralWorked like a charm! Pin
WREY16-Aug-03 7:37
WREY16-Aug-03 7:37 
Generalproblem in creating Modeless window Pin
Ph@ntom15-Aug-03 19:30
Ph@ntom15-Aug-03 19:30 
GeneralRe: problem in creating Modeless window Pin
Steve Mayfield15-Aug-03 20:16
Steve Mayfield15-Aug-03 20:16 
GeneralRe: problem in creating Modeless window Pin
Ph@ntom15-Aug-03 23:57
Ph@ntom15-Aug-03 23:57 
GeneralVB to C++ help... Pin
JoeSox15-Aug-03 19:00
JoeSox15-Aug-03 19:00 
GeneralRe: VB to C++ help... Pin
J. Dunlap15-Aug-03 19:25
J. Dunlap15-Aug-03 19:25 
GeneralRun application in safe mode !! Pin
rohit.dhamija15-Aug-03 18:28
rohit.dhamija15-Aug-03 18:28 
GeneralCan't generate release version - VC++6, multi-monitor app, Win98 Pin
normanS14-Aug-03 8:56
normanS14-Aug-03 8:56 
GeneralRe: Can't generate release version - VC++6, multi-monitor app, Win98 Pin
Tim Smith14-Aug-03 9:24
Tim Smith14-Aug-03 9:24 
GeneralNo - SDK is NOT for Win95, 98, ME Pin
normanS15-Aug-03 21:01
normanS15-Aug-03 21:01 
GeneralRe: Can't generate release version - VC++6, multi-monitor app, Win98 Pin
Michael Dunn15-Aug-03 18:57
sitebuilderMichael Dunn15-Aug-03 18:57 
GeneralRe: Can't generate release version - VC++6, multi-monitor app, Win98 Pin
normanS15-Aug-03 21:05
normanS15-Aug-03 21:05 
GeneralProblem Solved Pin
normanS15-Aug-03 23:51
normanS15-Aug-03 23: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.