Forethought: If it is needed then I can add the class definition. Problem: I get a STATUS_ACCESS_VIOLATION whenever I try to run this function in my program. I was wondering what was going on. Am I out of bounds somewhere? If I could reason it out myself I would. But I cannot figure it out alone. I'm very close to just hiring someone to do the debugging for me. It's worth my wile. So anyway, this needs to be looked over and given a little TLC. Thanks in advance!
int S_Rend::count(bitset<8> alpha, bitset<8> spec) {
int bn;
vector< bitset<8> > cnt;
bitset<8> curr;
int chmp;
eta = (alpha & spec);
theta = (alpha | spec);
cnt[0] = eta & alpha;
cnt[1] = eta | alpha;
cnt[2] = eta & spec;
cnt[3] = eta | spec;
cnt[4] = theta & alpha;
cnt[5] = theta | alpha;
cnt[6] = theta & spec;
cnt[7] = theta | spec;
cnt[8] = cnt[0] & cnt[5];
cnt[9] = cnt[6] | cnt[1];
cnt[10] = cnt[2] & cnt[7];
cnt[11] = cnt[4] | cnt[3];
for (int i=0;i<11;i++)
for (int j=i;j<=11;j++) {
curr = cnt[i];
if (cnt[j] == curr)
bn++;
if (bn>chmp)
chmp=bn;
}
return chmp;
}
int S_Rend::s_render(ifstream& in, ofstream& out) {
int i, n;
int t;
int chk;
in >> lambda;
in >> size;
in >> delta;
in >> chk;
t=(int&)beta;
int bn=0;
while (size-1>=bn) {
t=s_nop((int&)t,0);
cred.push_back(t);
bn++;
}
if (cred[bn-1]==chk)
cout << "\nValidity Pass... Success!" << endl;
else {
printf("\nValidity Pass...Fail! %u != %u",cred[cred.size()-1],chk);
return 1;
}
cout << "\nWriting to Buffer..." << endl;
i=0;
spec = lambda;
int f;
while (bn-1>=0) {
alpha = (int&)cred[bn-1];
f=count(alpha, spec);
eta = (int&)f;
spec ^= alpha ^ eta;
btrace.push_back(f);
cout << f << " ";
bn--;
}
cout << "One more second..\n";
while (i<=bn-1) {
delta = (int&)btrace[bn];
out << (const char)(int&)delta;
i++;
}
cout << "\nBuffer Written... Exiting..\n";
in.close();
out.close();
printf("*");
return 0;
}