Created
January 16, 2024 11:35
-
-
Save WarrenTheRabbit/6d51ada06f621f7e398058b11e779c45 to your computer and use it in GitHub Desktop.
The print array 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 <stdlib.h> | |
#include <stdio.h> | |
/** | |
* print_array - Prints an array of integers | |
* | |
* @array: The array to be printed | |
* @size: Number of elements in @array | |
*/ | |
void print_array(const int *array, size_t size) | |
{ | |
size_t i; | |
i = 0; | |
while (array && i < size) | |
{ | |
if (i > 0) | |
printf(", "); | |
printf("%d", array[i]); | |
++i; | |
} | |
printf("\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment