/*************************************************************************** vector.h - description ------------------- begin : Fri Jan 17 19:41:58 CST 2003 copyright : (C) 2003 by Daniel Eric Smith email : ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include template class vector { int dim; X u[10]; public: vector(int d) {dim=d;} X &operator[](int i); void get(); void put(); //friend istream& operator>>(istream& s, X& u); //friend ostream& operator<<(ostream& s, X u); }; template X &vector::operator [](int i) { if(i<0 || i>dim-1) { cout <<"\nIndex value of "; cout < void vector::get(); { cout <<"Enter the elemets of the vector:"<>(istream& s, X& u) { for(int i=0;i<=u.dim;i++) { cout <<"u["<>u[i]; } return s; } ostream& operator<<(ostream& s, X u) { cout<<"["; for(int i=0;i<=u.dim;i++) { s<