destructing error
used code:
#include "Vecmath.h"
#include <iostream>
using namespace std;
int main(){
Vector v = Vector(4.0, 4.0, 2.0);
cout << "(" << v.x << ", " << v.y << ", " << v.z << ")" << endl;
cout << "length: " << v.Length() << endl;
cout << "normalizing ..." << endl;
Vector vn = Normalize(v);
cout << "normalized" << endl;
cout << "(" << vn.x << ", " << vn.y << ", " << vn.z << ")" << endl;
cout << "length: " << vn.Length() << endl;
vn.x = 1.f; vn.y = 0.f; vn.z = 0.f;
Vector *v2 = new Vector();
Vector *v3 = new Vector();
CoordinateSystem(vn, v2, v3);
cout << "(" << vn.x << ", " << vn.y << ", " << vn.z << ")" << endl;
cout << "(" << (*v2).x << ", " << (*v2).y << ", " << (*v2).z << ")"
<< endl;
cout << "(" << (*v3).x << ", " << (*v3).y << ", " << (*v3).z << ")"
<< endl;
delete v;
delete vn;
delete (*v2);
delete (*v3);
return 0;
}
The error occurs at the delete statements at the end and reads:
1>c:\users\micha=EBl\documents\visual studio 2005\projects\renderwoman
\renderwoman\raytracer.cpp(22) : error C2440: 'delete' : cannot
convert from 'Vector' to 'void *'
1> No user-defined-conversion operator available that can
perform this conversion, or the operator cannot be called
same thing for line 22 to 25. Why does that happen? And deleting a
pointer should that be done by (*pointer) or just pointer ...