Quantcast
Channel: Memory leak in C++ program - Stack Overflow
Browsing latest articles
Browse All 5 View Live

Answer by quamrana for Memory leak in C++ program

In your Time constructor you are initialising hour and minute twice (just inefficient), but you are initialising dayTime with a strcpy. You only need this:Time::Time(int hour, int minute, string...

View Article



Answer by CB Bailey for Memory leak in C++ program

This constructor (assuming that strcpy_s is something like the standard function strcpy) is illegal.You've already initialized minute, hour and day in the initializer list so reassigning them in the...

View Article

Answer by Potatoswatter for Memory leak in C++ program

You're relying too much on manual memory management. It looks like you've added an object-oriented interface to a C program rather than using the features of C++. Try switching to storing strings in...

View Article

Answer by aJ. for Memory leak in C++ program

You are not deleting eventName in Event destructor.Event::~Event(){delete [] eventName;Also, Time::~Time() { delete[] dayTime; ^missing } Date::~Date() { delete[] month; }

View Article

Memory leak in C++ program

Thanks guys, for every const char * i went ahead and replaced it with string. THanks again!Could someone help please? :/ (This is not a homework question)#include <iostream>#include...

View Article

Browsing latest articles
Browse All 5 View Live




Latest Images