5 int promptValue(const char* msg
, int* result
) {
7 int retVal
= scanf("%d", result
);
8 return (retVal
== 1) ? 0 : 1;
11 void displayArray(const int array
[], unsigned length
) {
12 printf("--Begin--\n");
13 for (unsigned i
= 0; i
< length
; i
++) {
14 printf("array[%d]=%d\n", i
, array
[i
]);
19 void displayList(link_t
* head
) {
22 printf("--Begin--\n");
23 while (head
!= NULL
) {
24 printf("value at [%d]=%d\n", i
, head
->value
);