From 1c93a967a4553e8a5921fd93acceb62dad50aa21 Mon Sep 17 00:00:00 2001 From: vil02 <65706193+vil02@users.noreply.github.com> Date: Mon, 18 Aug 2025 00:00:30 +0200 Subject: [PATCH] fix: initialise `key` to avoid undefined behaviour --- search/hash_search.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/search/hash_search.cpp b/search/hash_search.cpp index 6e4caffc30..5643520aad 100644 --- a/search/hash_search.cpp +++ b/search/hash_search.cpp @@ -98,7 +98,7 @@ int hash_search(int key, int* counter) { // Hash lookup function /** main function */ int main() { link p; - int key, index, i, counter; // Key is the value to be found + int key = 0, index, i, counter; // Key is the value to be found index = 0; // You can write the input mode here