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

Because C uses call-by-value.

The variable s will be a fresh memory location each time make_me_upper is activated (entered). It's initial value is set to t. When the functioned is deactivated (exited), the variable s will vanish.
#include<stdio.h>

/* a function called make_me_upper, called by main */
int make_me_upper( char * s ) {
   int delta ;
   delta = 'a' - 'A' ;
   while (*s) {
      *s -= delta ;
      s++ ;
   }
}

int main(){
  char * t ;
  t = "shout" ;
  make_me_upper(t) ;    /* the function call */
  printf ("%s!\n",t) ;
}
What makes the while loop terminate? #Shuffle: none $PAGE$-A $PAGE$-B Return to Learn C Table of Contents #: The end of string causes the subroutine to crash. #: The end of string character is, as an integer, equal to 0, and 0 is false. #: