From 686e8a3bb7fc371d300aee357be6f24a5c77bee2 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Mon, 3 Oct 2022 17:38:09 +0200 Subject: fix segfault due to uninitialized member variable --- week-6/PuntContainer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/week-6/PuntContainer.cpp b/week-6/PuntContainer.cpp index 59b5fd7..e673472 100644 --- a/week-6/PuntContainer.cpp +++ b/week-6/PuntContainer.cpp @@ -1,3 +1,5 @@ +#include + #include "PuntContainer.h" #include "Punt.h" @@ -27,6 +29,7 @@ int PuntContainer::checkZ2(const Punt& punt1, const Punt& punt2) const { PuntContainer::PuntContainer() { this->puntRij = (Punt*) malloc(sizeof(Punt) * 10); + this->grootte = 0; } PuntContainer::~PuntContainer() { -- cgit v1.2.3