#Meta-Wlp: #Macro: TITLE wlp: Learn C (IV) p. 4
#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. #: