Question
C++ help! -Read all of the email addresses in the input file as strings into a 1-dimensional string array. Once weve read in each of
C++ help! -Read all of the email addresses in the input file as strings into a 1-dimensional string array. Once weve read in each of the emails (each email will be on its own line in the file and will span a row of the array), we will then extract the username part of the email and store it in another 1-dimensional string array (example: sample@ku.edu turns into sample). From there, we will output the usernames from the array to the console and to an output file. Since we dont know how many email addresses to expect, use an overly large array and treat it as a partially-filled array. Because were practicing with arrays, make sure the input file is closed before you do any outputting (this will force us to store the info in arrays). include:
#include#include #include -We want to use the .find and .substr methods to extract the username part of the email addresses.
***Sample Output
If this is the contents of our input file:
mrs.gloriamackenie@outlook.com
shand_lee@yahoo.com.hk
franklinosayandescott@gail.com
westernunion1233@yahoo.fr
Then both the console output and the output files contents will be:
mrs.gloriamackenie
shand_lee
franklinosayandescott
westernunion1233
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started