遠慮:如果它是需要的話,我可以添加類定義。 問題:我得到一個STATUS_ACCESS_VIOLATION每當我試圖在我的程序運行此功能。我想知道發生了什麼事。我在某處出界嗎?如果我能自己推理出來,我會的。但我無法單獨解決它。我非常接近僱用某人爲我進行調試。這是值得我遺憾的。無論如何,這需要查看並給予一點TLC。提前致謝!爲什麼這個功能不斷崩潰?
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;
}
當你使用一個調試器,該聲明(S)導致該問題?聲明中使用的變量的值是什麼? –
你應該用這樣的線做什麼? 'delta =(int&)btrace [bn];'?你爲什麼要投射到一個int引用? – PaulMcKenzie
請不要一次又一次重新發布相同的問題。另外,[tag:data-mining]顯然不是比特幣挖掘。 –