s there possible to create a program in C++ with the previously output. lname , fname [F] Adress Without have a problem with Las Vegas word. I have a hard time to figure how I can do the third line in the file. They read to word Las and then the compiler shows terminate called after throwing an instance of ' std::invalid_ argument ' what (): stoi aborted so I figured that the problem I have in one line
I have a text file and I want to read it in C++.
variables to use: fname, lname , Id nr, Gender and all third line which is an address
The file is :
Tommy James
23456731667
Streetname 45 , 154 23 Georgia
John Andersson
3456723464
Streetname 12 , 231 32 Las Vegas
Kim Larsson
3456312653
Streetnamn 15, 231 56 Florida
If we Said the 8th digit in ID number is showing the Gender of the person. By %2== 0 it's Male
The output should be:
Lname Fname [F]
address
Is there possible to create a program in C++ with the previously output.
lname , fname [F]
Adress
Without have a problem with Las Vegas word.
I have a hard time to figure how I can do the third line in the file. They read to word Las and then the compiler shows
terminate called after throwing an instance of ' std::invalid_ argument '
what (): stoi
aborted
so I figured that the problem I have in one line the city is two word.
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)