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.
Step by step
Solved in 2 steps