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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -