Website Summary Files Commits Branches @commit @diff @stats
path: root / pract SI / week8 / vector.h
diff options
context:
space:
mode:
Commit57b29ef0f28c587d93ffd5a1a5975629af3a7455 (patch)
Author
 Stoycho Kyosev <68247567+stoychoX@users.noreply.github.com>
2022-04-13 15:08:14 +0300
Committer
 GitHub <noreply@github.com>
2022-04-13 15:08:14 +0300
Files40546fef9cbfed60f907b062907b692cde4509bb /pract SI/week8/vector.h
Object-oriented_programming_FMI-57b29ef0f28c587d93ffd5a1a5975629af3a7455.tar
Object-oriented_programming_FMI-57b29ef0f28c587d93ffd5a1a5975629af3a7455.tar.gz
Object-oriented_programming_FMI-57b29ef0f28c587d93ffd5a1a5975629af3a7455.zip
Parenta5cf7d307da36f2e03dcfe8c5de1808e601a3c00 (diff)
Add files via upload
1 files changed, 29 insertions, 0 deletions
-rw-r--r--pract SI/week8/vector.h29
diff --git a/pract SI/week8/vector.h b/pract SI/week8/vector.h
new file mode 100644
index 0000000..bf7c947
--- /dev/null
+++ b/pract SI/week8/vector.h
@@ -0,0 +1,29 @@
+#ifndef VECTOR_HEADER
+#define VECTOR_HEADER
+
+class vector {
+private:
+ int* data;
+ size_t size;
+ size_t capacity;
+
+ void free();
+ void copyFrom(const vector&);
+ void resize(); // x2 memory
+public:
+ vector();
+ vector(const vector&);
+
+ vector& operator=(const vector&);
+
+ size_t getSize() const;
+ void push_back(int);
+
+ int& operator[](size_t);
+ const int operator[](size_t) const;
+
+ ~vector();
+};
+
+#endif
+