/*Pointer versions of table-handling functions ★七tab1efi11- ead va1 ues into table *table print rev -print values in reverse order. * int table fill(int a[] int max t int *ptr a /* pointer to first element * int *endptr ptr max; / pointer to just past 1 ast elemen七 for (ptr a; ptr endptri ptr++) if (scanf("i", ptr)!= 1) break return ptr -a;/* of values read successfully * void table print rev (int a[], int num) int *ptr a num;/* pointer to just past last element * while (ptr--> a) printf("i\n", *ptr); PROGRAM MINGMETHDOLODGY AND SOFTWAREENGINEERING 港城市大 Copyrighto1998 Angus Wu ol Hone KonePROGRAMMING METHDOLODGY AND SOFTWARE ENGINEERING Copyright©1998 Angus Wu /*Pointer versions of table-handling functions. *table_fill - read values into table. *table_print_rev - print values in reverse order. */ int table_fill(int a[], int max) { int *ptr = a; /* pointer to first element */ int *endptr = ptr + max; /* pointer to just past last element */ for (ptr = a; ptr < endptr; ptr++) if (scanf("%i", ptr) != 1) break; return ptr - a; /* # of values read successfully */ } void table_print_rev(int a[], int num) { int *ptr = a + num; /* pointer to just past last element */ while (ptr-- > a) printf("%i\n", *ptr); }