So part of the assignment I am working on is I have to figure out if residents are old enough for retirement. I am getlining a string from a file and now I just need to find the year. Problem is, I have no clue how to go about this.
Here is the code so far
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main(){
ifstream oldretire;
string names;
oldretire.open("oldretirement.txt");
getline(oldretire, names);
names find(
}
And here is a sample string
Matthew Alan Aberegg 1963 452,627
I am thinking I need to use the find function to find a string with a space, four characters, then another space. But then Aland would get found.
Any help would be appreciated!