#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
usingnamespace std;
void readCSV(std::istream &input, std::vector< std::vector<std::string> > &output)
{
std::string csvLine;
// read every line from the stream
while( std::getline(input, csvLine) )
{
std::istringstream csvStream(csvLine);
std::vector<std::string> csvColumn;
std::string csvElement;
// read every element from the line that is seperated by commas
// and put it into the vector or strings
while( std::getline(csvStream, csvElement, ',') )
{
csvColumn.push_back(csvElement);
}
output.push_back(csvColumn);
}
}
int main()
{
std::fstream file("bones.csv", ios::in);
if(!file.is_open())
{
std::cout << "File not found!\n";
return 1;
}
// typedef to save typing for the following object
typedef std::vector< std::vector<std::string> > csvVector;
csvVector csvData;
readCSV(file, csvData);
// print out read data to prove reading worked
for(csvVector::iterator i = csvData.begin(); i != csvData.end(); ++i)
{
for(std::vector<std::string>::iterator j = i->begin(); j != i->end(); ++j)
{
std::cout << *j << ", ";
}
std::cout << "\n";
}
system ("PAUSE");
return 0;
Can someone please help me create a class in which the user enters the action, and it will return which bone is involved. Also, the action are in 3rd person singular, but it must understand it in the imperative form, for example flexes verses flex.
Please someone help me. I would greatly appreciate it :]
I need to create one in which the user enters the action, and it will return which bone is involved.
I need to create one in which user enters body part (location), and it will return which bones are involved.
I need to create one in which user enters muscle, and it will return the
body part (location) along with deep or superficial.
Can I do this in one class or are three classes needed?