TP 13 exo1: return the dynamic array created or modified when necessary
[TD_C.git] / TP_13 / exo1 / lib / io.c
CommitLineData
33b9c646
JB
1#include <stdio.h>
2
3#include "io.h"
4
5int prompt_value(const char* msg, int* result) {
6 puts(msg);
7 int retVal = scanf("%d", result);
8 return (retVal == 1) ? 0 : 1;
9}
10
11void display_array(int* array, int size) {
34f864c6 12 printf("--array begin--\n");
33b9c646
JB
13 for (int i = 0; i < size; i++) {
14 printf("value in array at index[%d]=%d\n", i, array[i]);
15 }
34f864c6 16 printf("--array end--\n");
33b9c646 17}