I am getting this mesaage every time I run my code:
process exited with return value 3221225725
Please someone help me.
Here’s the code (a long list of primes to populate the vector omitted here for brevity):
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
vector <long long> Prime(664579);
Prime = {2, 3, ...., 9999991};
}
I want my code to return a value of 0.
Andrean Stephanus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
11
Exit code 3221225725
is 0xC00000FD
in hex, which is how Microsoft Windows indicates STATUS_STACK_OVERFLOW
. (This code is system-specific, see Pete Becker’s comment below.)
Essentially, your initializer list is too large. This is a known problem P2752R3, as explained here.
But the fix is currently supported only in GCC v14, see cppreference.
Anyway, as people have mentioned in comments to your question, never #include <bits/stdc++.h>
, because the standard C++ does not have that header, see Why should I not #include <bits/stdc++.h>
?.
Also, don’t use using namespace std;
, certainly never in headers, but preferably not in source code as well, see What’s the problem with using namespace std;
?.
3