Re: vector





hannibal200480@xxxxxxxx wrote:
> Hi everyone,
>
> Here about what it is.
>
> vector<vector<Point3D> > pVector0;
>
> pVector0 is a vector of vector of 3D points.
>
> pVector0[i] is a vector of 3D points.
>
> pVector0[i][j] is a 3D point.
>
> I wanted to add a point pt3D to the m vector in pVector0, I have
> write these two instructions which belong to a C++ program.
>
> vector< vector<Vector3D> > pVector0;
> pVector0[m].push_back(pt3D);
>
> I have as error message: Segmentation fault (core dumped)
>
> Could anyone give me suggestions?

1. Try an appropriate newsgroup, e.g. alt . comp . lang . learn .
c-c++, but they may require more information; comp.lang.c++ also.

2. They (other newsgroups, not sci.image.processing) will definitely
want to see the Point3D class, and the declaration (and creation) of
'pt3D'.

3. In programming it always helps to progress in stages -- learn to
walk before you attempt running; thus, get a single Vector of Point3D
working first. Indeed, before that, get a single Point3D working.

4. Just a slight suspicion ... have you already put a Vector of Point3D
at [m]?

>
> Thanks!
>
> hannibal

And be nice to those elephants.

Best regards,

Jon C.

.