From a82a54f081ce561e6bc6e9f82869f8b40a47e660 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 25 May 2022 19:59:16 +0300 Subject: Added my work from today's exam --- .../Object-oriented Programming/Exam 2/ex1/main.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Year 1/Object-oriented Programming/Exam 2/ex1/main.cpp (limited to 'Year 1/Object-oriented Programming/Exam 2/ex1/main.cpp') diff --git a/Year 1/Object-oriented Programming/Exam 2/ex1/main.cpp b/Year 1/Object-oriented Programming/Exam 2/ex1/main.cpp new file mode 100644 index 0000000..0ea5920 --- /dev/null +++ b/Year 1/Object-oriented Programming/Exam 2/ex1/main.cpp @@ -0,0 +1,20 @@ +#include "CombinedTrip.h" +#include + +int main() { + while (1) { + char** dest = new char*[3]; + for (unsigned i = 0; i < 3; i++) + dest[i] = new char[2]; + strcpy(dest[0], "A"); + strcpy(dest[1],"B"); + strcpy(dest[2], "C"); + + CombinedTrip ct(RegNumb(1, 2, 3, 4), 1, 5, "ASKDJHS", 35, (const char**)dest, 3, 57); + ct.print(); + + for (unsigned i = 0; i < 3; i++) + delete[] dest[i]; + delete[] dest; + } +} -- cgit v1.3.1-23-gd82d