the code I'm writing does compile, but when I run it through my IDE,
I keep getting this error message:
Executable “multicalc” has exited due to signal 10 (SIGBUS).
[Session started at 2004-12-29 11:17:36 -0500.]
Please enter a menu option:
Type 1 for simple calc
Type 2 for root calc
Type 3 for powers
Type 4 for circumferences
Type 5 for equations
Type 6 for vector math
Type 7 for help
Type 8 to quit:
6
Enter vector 1, hit enter after each element, and end your last element with "L":
Executable “multicalc” has exited due to signal 10 (SIGBUS).
the code I'm using is:
Code:
//vect.h
//does vector math
#include <iostream>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <sstream>
using namespace std;
using std::string;
class vect {
public:
vector <float> vector1;
vector <float> vector2;
string vectorsWhole[2];
vector <string> inread;
bool last;
int choice;
int vectIndex[2];
char func;
float scalar;
vector <float> vectorEQ;
bool lastElement(float num){
if(makeString(num).substr(makeString(num).length()-2,makeString(num).length()-1)=="l"){
return true;
}else{
return false;
}//end if
}//end last element
void vec(){
int i=0;
cout<<"Enter vector 1, hit enter after each element, and end your last element with \"L\":\n";
while(lastElement(atof(inread[i].c_str()))==false){
cin>>inread[i];
i++;
}//end while
for(i=0;i<vector1.size();i++){
cout<<inread[i]<<"\n";
}//end for
}//end vec
};//end class
the method vec is being called from the main cpp file
any advice?