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

It will print pops.

Remember: In C, the declaration char * s means that *s is a character.

s itself is a reference or pointer to an integer. Can you guess what,

     char ** gaga ;
would be? What type is **gaga? What type is *gaga?

A string is a sequence of characters, usually named by a reference to the first character, and subsequent characters are found using an integer added to the reference.

Sequence of integers, better known as integer arrays, are exactly the same.

#include<stdio.h>

int make_me_think( int * z, int count ) {
   int i = 0 ;
   while (count--) { 
      *(z+i) = i ;
      i++ ;
   }
}

int make_me_guess( int * z, int count ) {
   while (--count) printf("%d, ", *(z+count)) ;
   printf("%d\n",*z) ;
}

int main(){
  int my_array[7] ;  /* declare an array of seven integers */
  int * ip ;
  ip = my_array ;    /* ip is int-star, that is, *ip is an integer */
  make_me_think( ip, 7 ) ;
  make_me_guess( ip, 7 ) ;
}
What gets printed? #Shuffle: none $PAGE$-A $PAGE$-B $PAGE$-C Return to Learn C Table of Contents #: This program does not work. #: 1, 2, 3, 4, 5, 6, 7 is printed. #: 6, 5, 4, 3, 2, 1, 0 is printed. #: