Saturday 9 April 2022

Chapter 23 // Exercise 4 - Principles & Practice Using C++

In this exercise I am using Visual Studio 2019 and a modified version of the std_lib_facilities header found here.

Chapter 23 // Exercise 4

Find a real email message file (containing real email messages) and modify the email example to extract subject lines from sender names taken as input from the user.


I converted an email from my own account to text (hotmail) and it was very basic with just
From: Name <email>
Sent: DD Month YYYY HH:MM
To: Name <email>
Subject: Subject Message

Message

When a message is forwarded it's exactly the same but Fw: is added after Subject:

So, seeing as how the next exercise needs a text file with thousands of messages I decided to quickly create a "random email generator": 

You can use this to create a text file containing as many email messages as you want for testing.

I then went about changing everything to use wide strings instead so most currency symbols would work. I briefly tried to make emojis work but couldn't be bothered going down that rabbit hole.




No comments:

Post a Comment