Search found 10 matches

by MCanterel
December 31st, 2017, 9:59 pm
Forum: Everything
Topic: Memory leak in MemeFighter code- Intermediate 18
Replies: 10
Views: 4124

Re: Memory leak in MemeFighter code- Intermediate 18

chili wrote:
Who dares besmirch the good name of ChiliTomatoNoodle??! D:<
Aw sheeee-it. Did I just poke the bear? :shock:
by MCanterel
December 30th, 2017, 7:55 pm
Forum: Everything
Topic: Memory leak in MemeFighter code- Intermediate 18
Replies: 10
Views: 4124

Re: Memory leak in MemeFighter code- Intermediate 18

I needs me a red pill baby.
by MCanterel
December 30th, 2017, 4:26 pm
Forum: Everything
Topic: Memory leak in MemeFighter code- Intermediate 18
Replies: 10
Views: 4124

Re: Memory leak in MemeFighter code- Intermediate 18

Wow, yeah: braces = scope. Duh. Thanks Albi.
The address of the allocator for the t1 vector was exactly the one ref'd in _CrtDumpMemoryLeaks()!
But wait, are vectors allocated in the stack or the heap?
Also, dumb question: how do I add a screencap to these posts?
Thx, M
by MCanterel
December 30th, 2017, 2:51 am
Forum: Everything
Topic: Memory leak in MemeFighter code- Intermediate 18
Replies: 10
Views: 4124

Re: Memory leak in MemeFighter code- Intermediate 18

Here's my repo with the <crtdbg.h> code added:

https://github.com/MCanterel/Inheritance.git
by MCanterel
December 30th, 2017, 2:33 am
Forum: Everything
Topic: Memory leak in MemeFighter code- Intermediate 18
Replies: 10
Views: 4124

Re: Memory leak in MemeFighter code- Intermediate 18

Not really shots in the dark-- just added that to the master branch of chili's repo. But gimme a sec and I'll share my repo.
by MCanterel
December 29th, 2017, 10:59 pm
Forum: Everything
Topic: Memory leak in MemeFighter code- Intermediate 18
Replies: 10
Views: 4124

Memory leak in MemeFighter code- Intermediate 18

Hi All. Anyone notice a memory leak in the MemeFighter code from I-18? When I #include <crtdbg.h> and run _CrtDumpMemoryLeaks(); I get 4 leaked objects. However, cuz I'm new to all this, despite #define _CRTDBG_MAP_ALLOC and redefining the 'new' operator (per a bunch of StackOverflow posts), I can't...
by MCanterel
December 19th, 2017, 2:39 am
Forum: Everything
Topic: Just another const WTF in I-17.2
Replies: 3
Views: 1781

Re: Just another const WTF in I-17.2

Makes sense. TY guys.
by MCanterel
December 18th, 2017, 2:13 pm
Forum: Everything
Topic: Just another const WTF in I-17.2
Replies: 3
Views: 1781

Just another const WTF in I-17.2

In Intermediate 17.2, I was playing around with the ApplyDamageTo() function to try to understand the const modifier. void ApplyDamageTo(MemeFighter& target, int damage) const { std::cout << target.name << " takes " << damage << " damage." << std::endl; // hp += damage; //can't do this because funct...
by MCanterel
December 10th, 2017, 12:03 am
Forum: Everything
Topic: I-16 questions about functors
Replies: 2
Views: 1541

Re: I-16 questions about functors

it gets called inside the remove_if function, not at the callsite of remove_if
--that's what I needed to know. Thanks a!
by MCanterel
December 8th, 2017, 8:59 pm
Forum: Everything
Topic: I-16 questions about functors
Replies: 2
Views: 1541

I-16 questions about functors

Hey folks. Got a couple questions about function objects discussed in I-16. 1- This is from http://en.cppreference.com/w/cpp/algorithm/sort: // sort using a standard library compare function object std::sort(s.begin(), s.end(), std::greater<int>()); for (auto a : s) { std::cout << a << " "; } std::c...