Skip to content

Instantly share code, notes, and snippets.

@WarrenTheRabbit
Created January 17, 2024 04:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WarrenTheRabbit/d7c0f3000e7367ccef32d8d365f8fba1 to your computer and use it in GitHub Desktop.
Save WarrenTheRabbit/d7c0f3000e7367ccef32d8d365f8fba1 to your computer and use it in GitHub Desktop.
The print list function provided for Holberton's "C - Sorting algorithms & Big O" project
#include <stdio.h>
#include "sort.h"
/**
* print_list - Prints a list of integers
*
* @list: The list to be printed
*/
void print_list(const listint_t *list)
{
int i;
i = 0;
while (list)
{
if (i > 0)
printf(", ");
printf("%d", list->n);
++i;
list = list->next;
}
printf("\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment