Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commitbbd110ebcf4dcf2d13867ee70a5eb2cff32ea8b4 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-05 14:43:49 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-05 14:43:49 +0300
Filesea460e5f855365bb3ff33152c374099fbc404481
FMI-OOP-P1_TicketSystem-bbd110ebcf4dcf2d13867ee70a5eb2cff32ea8b4.tar
FMI-OOP-P1_TicketSystem-bbd110ebcf4dcf2d13867ee70a5eb2cff32ea8b4.tar.gz
FMI-OOP-P1_TicketSystem-bbd110ebcf4dcf2d13867ee70a5eb2cff32ea8b4.zip
Parent4e078ecef77dd202c19738f7587e4b7208f2996c (diff)
Autocommit at 05.05.2022 @ 14:43
2 files changed, 9 insertions, 8 deletions
-rw-r--r--src/ConsoleInterface/Menu.cpp9
-rw-r--r--src/List/List.hpp8
diff --git a/src/ConsoleInterface/Menu.cpp b/src/ConsoleInterface/Menu.cpp
index 190fe42..58477df 100644
--- a/src/ConsoleInterface/Menu.cpp
+++ b/src/ConsoleInterface/Menu.cpp
@@ -17,7 +17,7 @@ void Menu::navigate() const {
return;
}
- resetOrderedList();
+ resetOrderedList(0);
printOrderedListElem("Go Back");
for (unsigned i = 0; i < menuOptions.get_count(); i++)
printOrderedListElem(menuOptions[i].get_nameInMenu());
@@ -28,9 +28,8 @@ void Menu::navigate() const {
print(menuOptions.get_count());
print("]: ");
read(buffer);
- }
-
- if (buffer == 0) return;
- menuOptions[buffer - 1].run();
+ if (buffer == 0) return;
+ menuOptions[buffer].run();
+ }
}
diff --git a/src/List/List.hpp b/src/List/List.hpp
index 1e75c89..7088f2e 100644
--- a/src/List/List.hpp
+++ b/src/List/List.hpp
@@ -70,9 +70,11 @@ void List<T>::copyFrom(const List& other) {
template <class T>
List<T>::List(const T* elements, unsigned elementsCount) {
- count = length = 0;
- for (unsigned i = 0; i < elementsCount; i++)
- add(elements[i]);
+ length = 8;
+ count = elementsCount;
+ this->elements = new T[length];
+ for (unsigned i = 0; i < count; i++)
+ this->elements[i] = elements[i];
}
template <class T>