Hello all. I have a question for you. Please help.
Here's part of my code;
struct A_Key {
char* key;
long total;
};
struct A_Bucket {
vector<A_Key> storage;
int count;
int totalLen;
}bucket;
vector <A_Bucket*> myList; // vector element points to the address that bucket resides.
int main() {
....
bucket.count = 0;
myList.push_back(&bucket);
....
return 0;
}
---------------
My code compiles but when it runs to the line myList.push_back(&bucket) it give a core dumped. Can you please let me know what I did wrong and why core dumped occurs? Thanks for the help.
Sincerely
Here's part of my code;
struct A_Key {
char* key;
long total;
};
struct A_Bucket {
vector<A_Key> storage;
int count;
int totalLen;
}bucket;
vector <A_Bucket*> myList; // vector element points to the address that bucket resides.
int main() {
....
bucket.count = 0;
myList.push_back(&bucket);
....
return 0;
}
---------------
My code compiles but when it runs to the line myList.push_back(&bucket) it give a core dumped. Can you please let me know what I did wrong and why core dumped occurs? Thanks for the help.
Sincerely