subscript problem

Jimmy verma jim_938 at
Tue Jun 3 14:25:00 CEST 2003


I am having a problem with handling some pointers. My problem is like this:

typedef struct ab
      short n_p;
      Vec* po;
       short* con;
} AB;

typedef struct vec
      int x;
      int y;
} Vec;

Now the function:

XYZ(AB* out)
        last = out->con[n];            // last is of type int.
        lim = out ->po + last;        // lim is of type Vec.

        v_start = out -> po[first];   // v_start is of type Vec.

The problem is that when i use po[first] it gives an error message saying 

AttributeError: Vec instance has no attribute '__getitem__'

Can someone help me in sorting out the code for this in python.

Thanks in advance.


Himalayan holiday! Waiting to be won. Find out more.

More information about the Python-list mailing list