// Example 75 #include #include using namespace std; #include "vec6.h" int main() { vector u; vector v( 3.14, 2.73, 0.69 ); vector w = vector( -5, 8, -9 ); vector x( "7.1" ); cout.setf( ios::showpoint ); cout.setf( ios::fixed ); cout.precision( 3 ); u = vector( -3, 4, -5 ); assign( v, 2, 10, 13 ); w.assign( '2', 3 ); show( "u", u ); show( "v", v ); show( "w", w ); show( "x", x ); cout << endl;; cout << "u . w = " << dot( u, w ) << endl; w = x + v; show( "x + v", w ); cout << w[1] << "\n" << w[2] << "\n" << w[3] << endl; cout << "\n\n"; system( "PAUSE" ); return( EXIT_SUCCESS ); }