subscript problem

Jimmy verma jim_938 at hotmail.com
Tue Jun 3 08:25:00 EDT 2003


Hello,

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 
that

AttributeError: Vec instance has no attribute '__getitem__'


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

Thanks in advance.

Regards

_________________________________________________________________
Himalayan holiday! Waiting to be won. 
http://server1.msn.co.in/sp03/summerfun/index.asp Find out more.






More information about the Python-list mailing list