From 6b0f57d372c13c70b39c394155733436a6c7dccd Mon Sep 17 00:00:00 2001 From: northernSage Date: Wed, 17 Feb 2021 07:11:11 -0300 Subject: [PATCH] use stdbool.h instead of manually defined macros --- sorting/bubble_sort_2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sorting/bubble_sort_2.c b/sorting/bubble_sort_2.c index c26a0ca8..205de9e0 100644 --- a/sorting/bubble_sort_2.c +++ b/sorting/bubble_sort_2.c @@ -1,12 +1,12 @@ #include #include #define MAX 20 -#define TRUE 1 -#define FALSE 0 + +#include int main() { - int i, array_sort[MAX] = {0}, is_sorted = FALSE, change_place; + int i, array_sort[MAX] = {0}, is_sorted = false, change_place; /* For example Insertion random values in array to test @@ -21,7 +21,7 @@ int main() while (is_sorted) { - is_sorted = FALSE; + is_sorted = false; for (i = 0; i < MAX - 1; i++) { @@ -30,7 +30,7 @@ int main() change_place = array_sort[i]; array_sort[i] = array_sort[i + 1]; array_sort[i + 1] = change_place; - is_sorted = TRUE; + is_sorted = true; } } }