From c235b5f95e5f1adeada9d9c79616e1de2c0c81e3 Mon Sep 17 00:00:00 2001 From: n-tammy <49531039+n-tammy@users.noreply.github.com> Date: Thu, 6 Jun 2019 20:15:25 +0300 Subject: [PATCH] profile.cpp I'm not sure if it's correct, though. I thought it could be helpful, in reality terms, to end the program if the user's age is under 18. I googled it, still pretty unsure of that I added. I'd be much obliged if you could provide me the right answer, with a bit of an explanation... Thank you in advance :) --- 7-classes-and-objects/profile.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/7-classes-and-objects/profile.cpp b/7-classes-and-objects/profile.cpp index 4f40619..2a70fb3 100644 --- a/7-classes-and-objects/profile.cpp +++ b/7-classes-and-objects/profile.cpp @@ -9,6 +9,8 @@ Profile::Profile(std::string new_name, int new_age, std::string new_city, std::s age = new_age; } else { age = 0; + std::cout << "Sorry, you're too young.\n"; + std::exit(EXIT_SUCCESS); } }