Исключение std::bad_alloc - C++ - Обсуждение 2489144 |
|
Обсуждение
Всего сообщений: 23
|
||||
Имя | Дата | Сообщение | ||
Читать обсуждение полностью: Исключение std::bad_alloc |
||||
kurdupl1k | 07.08.2019 20:21 |
https://www.cyberforum.ru/post13758533.html
добрый день. столкнулся с проблемой - написал задачу...
|
||
oleg-m1973 | 07.08.2019 20:55 |
Решение https://www.cyberforum.ru/post13758577.html
Здесь например. Надо
private:
...
|
||
kurdupl1k | 08.08.2019 20:02 |
https://www.cyberforum.ru/post13760468.html
значит, тут уже не нужен деструктор?
|
||
oleg-m1973 | 08.08.2019 20:08 |
https://www.cyberforum.ru/post13760491.html
Если сделаешь std::vector<std::unique_ptr<Pet>> и...
|
||
kurdupl1k | 08.08.2019 20:12 |
https://www.cyberforum.ru/post13760502.html
я исправил, нужно так?
вот код:
// HomeZoo.h...
|
||
oleg-m1973 | 08.08.2019 20:19 |
https://www.cyberforum.ru/post13760509.html
Я так понимаю, не скомпилировалось.
Сделай...
|
||
kurdupl1k | 08.08.2019 20:21 |
https://www.cyberforum.ru/post13760520.html
я поменял, но у меня компилятор ругается. вот такую ошибку...
|
||
oleg-m1973 | 08.08.2019 20:23 |
https://www.cyberforum.ru/post13760522.html
На какую строчку?
|
||
kurdupl1k | 08.08.2019 20:25 | https://www.cyberforum.ru/post13760530.html | ||
oleg-m1973 | 08.08.2019 20:29 |
https://www.cyberforum.ru/post13760538.html
Наверное здесь. Надо this->zoo = sd::move(zoo);
Здесь...
|
||
kurdupl1k | 08.08.2019 20:38 |
https://www.cyberforum.ru/post13760549.html
исправил, но не помогает - ошибка осталась.
|
||
oleg-m1973 | 08.08.2019 20:42 |
https://www.cyberforum.ru/post13760551.html
Где то ещё осталось. Посмотри в окне Output, найди там...
|
||
kurdupl1k | 08.08.2019 20:50 |
https://www.cyberforum.ru/post13760567.html
наверное, проблема в 24 строке кода, а именно в этой:
...
|
||
oleg-m1973 | 08.08.2019 20:52 |
https://www.cyberforum.ru/post13760571.html
Нет, в другой
|
||
kurdupl1k | 08.08.2019 20:52 |
https://www.cyberforum.ru/post13760574.html
// HomeZoo.h
#pragma once
#include "Pet.h"
#include...
|
||
oleg-m1973 | 08.08.2019 20:53 |
https://www.cyberforum.ru/post13760575.html
Покажи main()
|
||
kurdupl1k | 08.08.2019 20:54 |
https://www.cyberforum.ru/post13760577.html
вот, что говорит окно output:
1>------ Build started:...
|
||
oleg-m1973 | 08.08.2019 20:56 |
https://www.cyberforum.ru/post13760580.html
void SetZoo(const std::vector<std::unique_ptr<Pet>> &zoo)
...
|
||
kurdupl1k | 08.08.2019 20:56 |
https://www.cyberforum.ru/post13760584.html
// main.cpp
#include "Pet.h"
#include "Cat.h"
#include...
|
||
oleg-m1973 | 08.08.2019 20:58 |
https://www.cyberforum.ru/post13760585.html
void SetZoo(std::vector<std::unique_ptr<Pet>> &&zoo)
...
|
||
kurdupl1k | 08.08.2019 21:00 |
https://www.cyberforum.ru/post13760594.html
это сеттер, я его и не вызываю. как бы, в мейне у меня...
|
||
oleg-m1973 | 08.08.2019 21:01 |
Решение https://www.cyberforum.ru/post13760597.html
Ну и убери его вообще
|
||
kurdupl1k | 08.08.2019 21:03 |
https://www.cyberforum.ru/post13760603.html
ЗАПУСТИЛОСЬ! спасибо большое за помощь!
|
||
|
||||
Similar |
Ошибка terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc выделение памяти Ошибка terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Ошибка terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Ошибка terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc |
|||
Ads |
|
|||
MoreAnswers |
Необработанное исключение в "0x76fd2eec" Microsoft C++: std::bad_alloc Ошибка terminate called after throwing an instance of 'std::bad_alloc' при работе с типом std::string std::bad_alloc Std::bad_alloc |
|||