+#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include "io.h"
#include "array.h"
-#include "utils.h"
int prompt_value(const char* msg, int* result) {
puts(msg);
*old_size = new_size;
}
+void handle_prompt_error(int errno) {
+ if (errno != 0) {
+ printf("\nMerci de saisir un nombre entier, exiting\n");
+ /* it's somewhat violent but better than looping forever */
+ exit(EXIT_FAILURE);
+ }
+}
+
void display_array(int array[], unsigned size) {
if (array != NULL) {
printf("\n--array begin--\n");