From 799c5002e8b4fa9d7e6eb2068e3422741f0d1d7a Mon Sep 17 00:00:00 2001 From: JYJSXX Date: Wed, 28 Aug 2024 14:18:44 +0800 Subject: [PATCH] ver 1.1 --- src/main.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 6392b93..fdba3bd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,6 +3,13 @@ #include "Student.hpp" #include +class check{ + public: + explicit check(Student* student){ + printf("Student object created\n"); + } +}; + int main(int, char**){ printf("Hello, from stl_debug!\n"); std::vector vec; @@ -13,5 +20,6 @@ int main(int, char**){ for (const auto& h : vec) { h->print(); } - static_cast(vec.back())->print(); + auto student1 = static_cast(vec.back()); + check check1 = check(student1); } -- GitLab