Solved
cpp programming in passing objects as references
Posted on 2003-03-17
hello everyboby!
i am doing a project in which i am using 2 functions namely
1.sq::sq(std::vector<hvector>& points, sq &init);
i am using this function for constructing a 3D image and fitting some 3d points in it.so the arguments goes like this
points are the 3D points and hvector is a class defined as
class hvector {
public:
double x;
double y;
double z;
so i called the above function as
sq s2=sq(&points,&s1);
where points are of type hvector and s1 is an object of sq.
but i am getting the error as :
main1.cpp:134: no matching function for call to `sq::sq (vector<hvector,allocator<hvector> > *, sq *)'
the other function i am using is
void sq::plotSQsPlusPoints(ofstream& out, const std::vector<hvector>& vPoints );
this is used for diaplaying the sq and the points.
so i am calling the above function as
s2.plotSQspluspoints(out,&points);
where out ias an ofstream and points are the 3D points.
but i am getting the error as
main1.cpp:140: no matching function for call to `sq::plotSQspluspoints (ofstream &, vector<hvector,allocator<hvector> > *)'
i will be thankful and convey my regards if i could get a solution.
with regards
aravind