Online Degrees and CLEP and DSST Exam Prep Discussion
Straighterline C++ - Printable Version

+- Online Degrees and CLEP and DSST Exam Prep Discussion (https://www.degreeforum.net/mybb)
+-- Forum: Main Category (https://www.degreeforum.net/mybb/Forum-Main-Category)
+--- Forum: General Education-Related Discussion (https://www.degreeforum.net/mybb/Forum-General-Education-Related-Discussion)
+--- Thread: Straighterline C++ (/Thread-Straighterline-C)



Straighterline C++ - gingerbeefE - 10-21-2015

Currently taking this course and I am having issues with the Assignment 7 Marketing Software.


I have it all coded but when I enter all the information at the cmd it gives me a

"terminate called after throwing an instance of 'std::bad_alloc'
what(): stdbad_alloc"

any experienced programmers want to take a look at my code?


Straighterline C++ - Outis - 10-21-2015

gingerbeefE Wrote:Currently taking this course and I am having issues with the Assignment 7 Marketing Software.


I have it all coded but when I enter all the information at the cmd it gives me a

"terminate called after throwing an instance of 'std::bad_alloc'
what(): stdbad_alloc"

Anyone have their code so I can figure out what I did wrong or any experienced programmers want to take a look at my code?

Hi gingerbeefE,

It's difficult to say without seeing all of the code. I would be careful posting all of it in a public place, as it may violate some SL policy in regards to work/test material. However, the error message does give a big hint: you are out of memory. Follow your code line by line and see if you are allocating memory space correctly, or if you are attempting to place data in a structure with limited space. If you can't do it by visually examining the code (I have no idea how many lines it is), you might consider using try, throw, catch expressions around each significant portion of your code to narrow down the source of the issue.


Straighterline C++ - bluebooger - 10-21-2015

look at the bottom answer here
Eclipse C++ error : terminate called after throwing an instance of 'std::bad_alloc' - Stack Overflow

if that doesn't help then look through some of these
https://www.google.com/search?q=%22terminate+called+after+throwing+an+instance+of+%27std%3A%3Abad_alloc&oq=%22terminate+called+after+throwing+an+instance+of+%27std%3A%3Abad_alloc&aqs=chrome..69i57&sourceid=chrome&es_sm=0&ie=UTF-8

you can almost always paste your error message into google and do a search and get some help

that's what I did there