the code I'm using is this:
//vector.h
//does vector math
#include <iostream>
#include <string>
#include <cmath>
#include <cstdlib>
using namespace std;
using std::string;
class vector {
public:
float *vector1;
float *vector2;
string vectorsWhole[2];
string inread;
bool last;
int choice;
bool lastElement(){
if(inread.substr(inread.length()-2,inread.length()-1)=="l"){
return true;
}else{
return false;
}//end if
}//end lastElement
};//end class
void vec(vector v){
cout<<"Enter one of the following options:\n\nType 1 for addition/multiplication/subtraction/division\n\nType 2 for dot products\n";
cin>>v.choice;
switch(v.choice){
case 1:
cout<<"Enter the numbers in the first vector, 1 at a time\nadd the character l to the end of your last element:\n";
while(v.lastElement()==false){
cin>>v.inread;
v.vectorsWhole[0]+=v.inread;
if(v.lastElement()==false){
v.vectorsWhole[0]+=",";
}//end if
}//end while
cout<<v.vectorsWhole[0];
break;
default:
break;
//end case
}//end switch
}//end vec
I know, the code is simple, don't laugh, especially at the switch statement
anyway, As is seen in the while loop, I'm trying to get input until a character is appended to the last input
whenever I compile it, I get no errors
when I run it, as soon as it enters the while loop it exits "due to signal 6 (SIGABRT)"
any insight?