[Tutor] subscript problem
Jimmy verma
jim_938@hotmail.com
Tue Jun 3 08:26:01 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
_________________________________________________________________
Want free fuel? Get IOC Citibank card.
http://server1.msn.co.in/msnleads/citibankcards/ioc.asp Drive your dreams!