[Dev-C++] Access Violation (Segmentation Fault)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Kenneth P. R. <kpr...@op...> - 2004-06-27 06:53:50
|
When I debug this program, I get "Warning: An Access Violation
(Segmentation Fault) raised in your program." When I get this error
msg, I end up in stl_construct.h.
----------------------------------------------------------------------------------------------------------------------------
int Range=0;
int PreviousRange=0;
vector<int> Groupset; // subscripts/pointers to Groupset ranges
ofstream DGroupset("W:\\AAAnalysis\\DGroupset.txt");
ofstream DWDRlist("W:\\AAAnalysis\\DWDRlist.txt");
....
int main() {
....
if (Mtglist[i].substr(0,1) == "*") {
if (Mtglist[i].size() == 8) {
Groupset.push_back(Range);
<=======================> Here's the stmt that yields the error.
DGroupset << Range << endl;
DWDRlist << Mtglist[i] << endl;
PreviousRange=Range;
TWDR++;
}
}
-----------------------------------------------------------------------------------------------------------------------------
I know that you always want to see the entire program, but it is over
300 lines long, so please let's see if anyone can see anything glaringly
wrong with this, okay?
At the moment of error, Range = a valid integer.
DGroupset is merely a disk image of the vector so I can see what's going on.
I have checked if "Range" is a reserved word (it is not).
I have checked if a vector<int> needs any special handling (it does not).
I have chkdsk'ed the partition.
What could cause this? What are some causes a Segmentation Fault?
TIA,
Ken
|