#Meta-Wlp: #Macro: TITLE wlp: Learn C (IV) p. 8 #Eval: $TITLE$ #Macro: PAGE bb4-8

The numbers are printed backwards

An array of integers is a sequence of integers, often references as int-star.

The difference between an array of integers and int-star is that declaring an array of integers sets aside room for all the integers in the array. Int-star just sets aside room for a reference to integers.

#include<stdio.h>

int count_backwards( int * z, int * ip ) {
   while (z!=ip) printf("%d, ", *ip-- ) ;
   printf("%d\n",*ip) ;
}

int main(){
  int my_count[3] ;
  *(my_count+0) = 0 ;
  *(my_count+1) = 1 ;
  *(my_count+2) = 2 ;
  count_backwards( my_count, my_count+2 ) ;
}
What makes the while loop terminate? #Shuffle: none $PAGE$-A $PAGE$-B Return to Learn C Table of Contents #: The value zero gets printed. #: The reference ip is decremented until it agrees with z, which is the start of the array of three integers. #: