for loop in C: return each processed element -


i have linked list, , want write function go through each node, , return appropriate elements. this:

struct list* returnelements(struct list *head){      (; head != null ; head=head->next){          if (head->field1 == "something")              return head;      } 

and function called returnelements have somehow catch each returned node, , it.

is somehow possible?

i think easier without function right inside function call returnelements make new variable , set type struct list* , traverse list within function , if find node need use something this:

struct list *temp = head; for(; temp != null; temp = temp->next) {     if(strcmp(temp->field1, "something") == 0) {         //do whatever want node     } } 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -