1 /* File : example.cxx */
3 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
4 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER)
5 # define _CRT_SECURE_NO_DEPRECATE
12 Vector operator+(const Vector &a, const Vector &b) {
20 char *Vector::print() {
21 static char temp[512];
22 sprintf(temp,"Vector %p (%g,%g,%g)", this, x,y,z);
26 VectorArray::VectorArray(int size) {
27 items = new Vector[size];
31 VectorArray::~VectorArray() {
35 Vector &VectorArray::operator[](int index) {
36 if ((index < 0) || (index >= maxsize)) {
37 printf("Panic! Array index out of bounds.\n");
43 int VectorArray::size() {