Created
January 17, 2024 04:43
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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