so I have this class with a functions.hpp and a functions.cpp
#include "function.hpp"
test::test(int size)
{
this->size = size;
matrix = new int*[this->size];
for (int i = 0; i < size; i++)
{
matrix[i] = new int[this->size];
}
}
test::~test()
{
for (int i = 0; i < this->size; i++)
delete[] this->matrix[i];
delete[] this->matrix;
}
but this still produces memory leaks, I am using the CRT library to test this
#include "function.hpp"
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
int main()
{
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
int size = 10;
test test(size);
_CrtDumpMemoryLeaks();
return 0;
}
this code still dumps memory leaks on me, and I've followed several tutorials and I'm starting to doubt either the CRT library or my computer.
<data-type>*in C++