where is the problem?

Status
Not open for further replies.

fly_on_the_nose

Newbie level 2
Joined
Jun 13, 2012
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,290
Why don´t work right? Please help

T* getItem(List *list, int pos)
{
if(!list || pos < 0 || pos >= list->length)
return NULL;

int u;
ListItem *ha = list->first;
for(u = 0; u < pos; u++)
{
ha = ha->next;
if(!ha)
return NULL;
}
return (T*)ha;
}
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…