int main() {
int a1,a2,a3,b1,b2,b3;
cout << "Cross Product Calculator\n"
<< "Enter 3D vector a:\n"
<< "a1: ";
cin a1;
cout << "a2: ";
cin a2;
cout << "a3: ";
cin a3;
cout << "Enter 3D vector b:\n"
<< "b1: ";
cin b1;
cout << "b2: ";
cin b2;
cout << "b3: ";
cin b3;
int d1 = determinant(a2,a3,b2,b3);
int d2 = determinant(a1,a3,b1,b3);
int d3 = determinant(a1,a2,b1,b2);
cout << "\nThe Cross Product is:\n" << cProd(d1,d2,d3) << std::endl;
}
I tried this on two compilers, Visual c++ 2010, and g++, both said that the a1,a2,a3,b1,b2,b3 need a ";" BEFORE the variable. Why is that?
That's because you are using cin incorrectly and confusing the compiler.
can you give an example on how i should use it?
ah gotcha, it's been a while forgot the operator thanks
Hey, no problem. Glad to help =]