Im trying to write a program that lists only the users names which are stored inside a text file and also displays the numbers of users in it.
The format of my txt file is:
id name birthdate
for example:
1 2 3
200 john birthdate
301 casey birthdate
204 leo birthdate
In this case the output would be:
3 users found
and the users names only.
So far I've been able to count the numbers of users with the follow code:
As for listing the users names I simply dont know how to do it. I know getline is able to read the entire line but in this case Im just trying to read the second word of each line from the text. Bare in mind Im very new to cpp.