Cleanups.
[TD_C.git] / exo1 / lib / io.c
1 #include <stdio.h>
2
3 #include "io.h"
4
5 int prompt_value(const char* msg, int* result) {
6 puts(msg);
7 int retVal = scanf("%d", result);
8 return (retVal == 1) ? 0 : 1;
9 }
10
11 void display_array(int* array, int size) {
12 for (int i = 0; i < size; i++) {
13 printf("value in array at index[%d]=%d\n", i, array[i]);
14 }
15 }