![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#21 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 882
Rep Power: 4
![]() |
This code:
for(int j = index+1; j<tableSize; j++)
{
if(strncmp (table[j].c_str(),test.c_str(),3) == 0)
{
table[j] = holder[i];
cout << holder[i] << " ADDED AT POSITION " << j << endl;
}
else
end = true; // Used to wrap around the array if no empty locations before end of array
} |
|
|
|
|
|
#22 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 882
Rep Power: 4
![]() |
With that and the next loop fixed I get this output
1 : with 2 : will 3 : goat 4 : and 5 : or 6 : boat 7 : with 8 : eat 9 : train 10 : I 11 : box 12 : fox 13 : there 14 : ~~~ 15 : Eggs 16 : not 17 : house 18 : ~~~ 19 : Sam 20 : ~~~ 21 : am 22 : rain 23 : would 24 : ~~~ 25 : do 26 : any 27 : ~~~ 28 : ~~~ 29 : them 30 : here 31 : where 32 : ~~~ 33 : ~~~ 34 : a 35 : Ham 36 : will 37 : like 38 : Green 39 : eat 40 : Don't 41 : ~~~ 42 : ~~~ 43 : in 44 : could 45 : ~~~ 46 : the 47 : on |
|
|
|
|
|
#23 |
|
Unverified User
Join Date: Sep 2005
Posts: 209
Rep Power: 0
![]() |
And yes Jimbo, that is the exact output I got, with repetitions.
OK, breaks do work in the for loop. NICE! THANK YOU DARK - Saving the day AGAIN! Last edited by codylee270; Nov 21st, 2006 at 10:18 PM. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| c++ linkage errors | angry_asian | C++ | 11 | Jun 24th, 2006 8:05 PM |
| String I/O and Vector Insert errors | wingz198 | C++ | 1 | Oct 18th, 2005 10:47 PM |
| Very annoying errors | Aphex_Twin | C++ | 2 | Jun 9th, 2005 4:43 PM |
| Function Calls and Errors! | glopal | C++ | 5 | May 4th, 2005 11:09 AM |
| scandir etc errors in MSVC. | Siphon | C++ | 5 | Feb 4th, 2005 4:15 AM |