void setValue_any_LList(LList* myList, const unsigned int index, const int value) - AmiralBl3ndic/CLib_v2 GitHub Wiki

void setValue_any_LList(LList* myList, const unsigned int index, const int value)

Sets the value of the specified element (node) of the LList by its subscript (index)


Parameters:

  • LList* myList: pointer on any element of the LList
  • const unsigned int index: index in the LList of the element (node) to modify
  • const int value: value to set

Example:

LList* myList = init_LList(8);

setValue_any_LList(myList, 4, 42); //Sets the value of the 5th element (5 - 1 = 4) of the myList to 42 

setValue_any_LList(myList, 12, 107); //Does nothing since element 12 doesn't exist