From d610ef690f9e131dcd839c3dd3545fb2417859f4 Mon Sep 17 00:00:00 2001 From: Hannes Kuchelmeister Date: Sun, 10 Jan 2021 15:23:40 +0100 Subject: [PATCH] fix compilation error --- Assignment_3/lib/ADT_Stack.h | 7 ++++++- Assignment_3/lib/Stack.cpp | 2 +- Assignment_3/main.cpp | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Assignment_3/lib/ADT_Stack.h b/Assignment_3/lib/ADT_Stack.h index e9b53ed..aaa2ba7 100644 --- a/Assignment_3/lib/ADT_Stack.h +++ b/Assignment_3/lib/ADT_Stack.h @@ -1,3 +1,6 @@ +#ifndef ADT_Stack_H +#define ADT_Stack_H + #include #include #include @@ -30,4 +33,6 @@ class ADTOperationQueue{ void enqueue(operation op); operation dequeue(); size_t size(); -}; \ No newline at end of file +}; + +#endif \ No newline at end of file diff --git a/Assignment_3/lib/Stack.cpp b/Assignment_3/lib/Stack.cpp index 8774ec6..c629822 100644 --- a/Assignment_3/lib/Stack.cpp +++ b/Assignment_3/lib/Stack.cpp @@ -12,7 +12,7 @@ Stack::Stack(ADTOperationQueue * queue){ void Stack::push(int element) { return; } int Stack::pop() { return 0; } -void Stack::size() { return 0; } +int Stack::size() { return 0; } std::string Stack::print_stack(){ Node* c = this->first->next; diff --git a/Assignment_3/main.cpp b/Assignment_3/main.cpp index e5f6e4c..b8f74db 100644 --- a/Assignment_3/main.cpp +++ b/Assignment_3/main.cpp @@ -41,6 +41,7 @@ std::vector generate_operations_uniform(){ break; } } + return operations; } void run_worker(std::vector* operations, Stack* stack) {