First off I am running my program in Eclipse on Virtual box in Linux.
My program crashes when I add an additional array. I have not even used this array. So I am wondering if I am using too much memory.
Here are my data structures I create at the top of the program.
//used in task 0
class CFG_Rules {
public:
string LHS;
string RHS[500];
int ruleNumber;
};
//used in task 1
class CFG_Rules1 {
public:
string LHS;
string RHS[500];
int numberOfRHSeachRule;
};
//used in task 1
class FIRST_SETS {
public:
string firstSetsNonTerminals;
vector<string> vFirst;
set<string> sFirst;
int numberOfSets;
};
//used in task 1
class CFG_Rules2 {
public:
string LHS;
string RHS[500];
int numberOfRHSeachRule;
};
//used in task 2
class FOLLOW_SETS {
public:
string followSetsNonTerminals;
set<string> sFollow;
int numberOfFollowSets;
};
I create some arrays in main here
//creating data structure of rules
CFG_Rules myRules[1000];
//creating data structure of rules for task1
CFG_Rules1 myRules1[1000];
//creating data structure of First Sets for task 1
FIRST_SETS firstSets[1000];
//creating data structure of rules for task2
FOLLOW_SETS followSets[1000];
The issue comes here
the entire program works.
But once I create this array
CFG_Rules2 myRules2[1000];
The program crashes when I run it.
I don't even use this array. When I remove it, the program works when I run it.
Any ideas of what is happening?? Am I running out of memory in Eclipse??
My program crashes when I add an additional array. I have not even used this array. So I am wondering if I am using too much memory.
Here are my data structures I create at the top of the program.
//used in task 0
class CFG_Rules {
public:
string LHS;
string RHS[500];
int ruleNumber;
};
//used in task 1
class CFG_Rules1 {
public:
string LHS;
string RHS[500];
int numberOfRHSeachRule;
};
//used in task 1
class FIRST_SETS {
public:
string firstSetsNonTerminals;
vector<string> vFirst;
set<string> sFirst;
int numberOfSets;
};
//used in task 1
class CFG_Rules2 {
public:
string LHS;
string RHS[500];
int numberOfRHSeachRule;
};
//used in task 2
class FOLLOW_SETS {
public:
string followSetsNonTerminals;
set<string> sFollow;
int numberOfFollowSets;
};
I create some arrays in main here
//creating data structure of rules
CFG_Rules myRules[1000];
//creating data structure of rules for task1
CFG_Rules1 myRules1[1000];
//creating data structure of First Sets for task 1
FIRST_SETS firstSets[1000];
//creating data structure of rules for task2
FOLLOW_SETS followSets[1000];
The issue comes here
the entire program works.
But once I create this array
CFG_Rules2 myRules2[1000];
The program crashes when I run it.
I don't even use this array. When I remove it, the program works when I run it.
Any ideas of what is happening?? Am I running out of memory in Eclipse??