void pushback_LList(LList* myList, int value) - AmiralBl3ndic/CLib_v2 GitHub Wiki

void pushback_LList(LList* myList, int value)

This function adds an element to the end of a linked list


Warning

This function adds a new element by allocating it, it changes the size of the LList and may cause the program to stop in case of bad allocation due to use of function check_alloc()


Parameters:

  • LList* myList: pointer on any element (node) of the linked list
  • int value: the value to add to the linked list

Example:

LList* myList = init_LList(8); //last element id = 7
pushback_LList(myList, 42); //9 elements, last element id = 8, element 8 = 42