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

Yes, the end of string marker is 0

Would this program work the same?
#include<stdio.h>

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

int main(){
  char * t ;
  t = "shout" ;
  make_me_upper(t) ;    /* the function call */
  printf ("%s!\n",t) ;
}
Hint: it there is any justice in the world, what should s+0 be exactly the same as? And if i++ is i+1, what would s++ be? #Shuffle: none $PAGE$-A $PAGE$-B Return to Learn C Table of Contents #: No, this program cannot work, you cannot add integers and char-stars. #: Yes, this is another to do it. #: