Is "bad_aloc" a program issue or a resource issue in c++? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 1

Is "bad_aloc" a program issue or a resource issue in c++?

15th Apr 2022, 2:05 AM
Mohammed
1 ответ
+ 1
bad_alloc can also be thrown when you have a bug that is overwriting the pointers that the heap uses to manage the pool of memory that it uses to allocate from. The most common cause of that is that you are writing past the end of an allocated block of memory, (or before the start, but that's less common).
15th Apr 2022, 4:33 AM
Abhivarshini Maddala
Abhivarshini Maddala - avatar