//Read in name and year born from a file as a sting #include #include #include using namespace std; int main(void) { string name,input,yearString; int yearborn, age,count=0; int currentYear=2016; ifstream people("c:/mycpp/names2.txt"); //input file stream if(people) { //file was opened cout<<"NAME\tAGE\n"; //heading while(getline(people,input)) { //Example: input="Jay,1994" int p=input.find_first_of(","); //Example: p=3 if(p<0) cout<<"Error: "<