I realize that I've marked this as solved, but...I'd like to ask a follow-on question:
If I wanted to make my getVector() function a little more flexible, so I can specify whether to read the file in hex or decimal notation, what's the best way to do this? Here's what it currently looks like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
int getVector(ifstream& s,
long nbrCells,
vector<FlipFlopReg32>::iterator iter)
{
int rc = 0;
int32_t temp;
for (int i = 0; i < nbrCells; i++)
{
s >> hex >> temp;
*iter++ = temp;
}
if (s.fail())
rc = 1;
return rc;
}
Can I change that "hex" to a variable somehow, and have that variable passed through by a calling routine?
EDIT: this question is different enough from the original that I'll ask it in another thread. Thanks.