End Google Ads 201810 - BS.net 01 --> I'm baffled. I know where the problem line is. I just don't understand the problem except to add that it likely relates to either pointer or reference or both. Hopefully, all code needed is included. Thanks in advance. Sorry for the code dump, but I think it may all be needed....(since I don't really know what the problem is....


Unhandled exception at 0x5dd97b3f (msvcp90d.dll) in Parser6.exe: 0xC0000005: Access violation writing ******** 0xcdcdcdcd.

FROM OUTPUT...
First-chance exception at 0x5dd97b3f (msvcp90d.dll) in Parser6.exe: 0xC0000005: Access violation writing ******** 0xcdcdcdcd.
Unhandled exception at 0x5dd97b3f (msvcp90d.dll) in Parser6.exe: 0xC0000005: Access violation writing ******** 0xcdcdcdcd.


Here is the line from some internal file that is getting pointed at by the compiler. FileName = xutility. Bad line is labeled.

inline void __CLR_OR_THIS_CALL _Container_base_secure::_Orphan_all() const
{ // orphan all iterators
_Lockit _Lock(_LOCK_DEBUG);
if (_Myfirstiter != _IGNORE_MYITERLIST)
{
for (_Iterator_base **_Pnext = (_Iterator_base **)&_Myfirstiter;
*_Pnext != 0; *_Pnext = (*_Pnext)->_Mynextiter)
BAD LINE HERE --> (*_Pnext)->_Mycont = 0;
*(_Iterator_base **)&_Myfirstiter = 0;
}
}

Here is the Collector constructor with the problem code labeled near the end.
Note that the constructor is taking in a reference. This may be related to error.
#include "Collector.h"
#include "Token_stream.h"
#include "Multiplier.h"
#include
#include
using namespace std;


Collector::Collector(Multiplier& myMultiBox, int MaxSNM): myMultiplier(myMultiBox)
{
cin.clear();
cin.ignore(1000, '\n');
BaseIP = GetOctets2( MaxSNM);
NetworkBits = ConvertToNetworkBits( BaseIP);

vector Boxes;
vector test(31,9);
for (int i = 0; i < (myMultiplier.GetTheBoxSet()).size(); i++)
{
Boxes = (myMultiplier.GetABoxMaker(i))->GetMyBoxes();
for (int z = 0; z < Boxes.size(); z++)
{

THIS DOESN'T WORK-> Boxes[z]->SetMyNetworkBits(test);
THIS DOESN'T WORK-> Boxes[z]->SetMyBaseIP(BaseIP);
THIS WILL RUN ALONE-> Boxes[z]->PRINT_NETWORK();
}
}

}

Here is main

#include "AllHeaders.h"
using namespace std;

int main()
try{
StartMeUp KickStart;

Multiplier MultiBox(KickStart.GetMyHosts());
BoxMaker* temp = MultiBox.GetABoxMaker(0);
BoxMaker* temp1 = MultiBox.GetABoxMaker(1);
BoxMaker* temp2 = MultiBox.GetABoxMaker(2);
BoxMaker* temp3 = MultiBox.GetABoxMaker(3);

PureStack FirstT(temp );
StackSmallHigh SecondT(temp1);
PureReserve ThirdT(temp2);
ReserveSmall FourthT(temp3);
cout GetMyVLSM();

Collector TheCollector(MultiBox, MaxSNM);


system("PAUSE");
return 0;
}

catch (exception& e)
{
cerr