Here's my code so far, but it's not pulling any data from my file at all.
#include <iostream>
#include <string>
#include <fstream>
#include <iomanip>
using namespace std;
/*
*
*/
int main()
{
//declare variables
string firstname;
string lastname;
string reading;
string systolic;
string diastolic;
int loopcount;
ifstream patient;
string line;
//open file
patient.open("patient.open");
patient >> line;
firstname = line.substr(0,8);
lastname = line.substr(8,12);
systolic = line.substr(14,16);
diastolic = line.substr(17,19);
//print name to screen
cout << lastname;
cout << ", " << firstname;
return 0;
}
The attached file shows what i'm trying to accomplish by the end of my program

New Topic/Question
Reply



MultiQuote







|