Website Summary Files Commits Branches @commit @diff @stats
path: root / src / List
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 /src/List
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
1 files changed, 5 insertions, 3 deletions
-rw-r--r--src/List/List.hpp8
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>