1#include <iostream>2 using namespacestd;3 4 voidTo_lower (Char*s)5 {6 while(*s!=' /')7 {8 if(*s>='A'&&*s<='Z')9*s+= +;Tens++; One } A } - - Char* STRDUP1 (Const Char*s) the { - Char*p=New Char[]; -cout<<sizeof(s) <<endl;//////////Note - inti; + for(i=0; s[i]!=' /'; i++) - { +p[i]=S[i]; A } atp[i]=' /'; - returnp; - } - - Char* FINDX (Const Char*s,Const Char*x) - { in intI=0; - while(*s!=' /') to { + while(* (S+i) ==* (x+i) &&* (x+i)! =' /') - { thei++; * } $ if(* (x+i) = =' /')Panax Notoginseng return(Char*) s; - Else theI=0; +s++; A } the returnNULL; + } - $ intMain () $ { - //Char c[]= "D"; - //cout<<sizeof (&c) <<endl; //////////Note the //Char *p=strdup1 (c); - //cout<<p<<endl;Wuyi Charc1[]="FGASDFGHJ"; the Charc2[]="FGH"; -cout<<findx (C1,C2); Wu while(1); - return 0; About $}
Exercise 3 4 5Exercise TenExercise 11 Exercises 14 Exercise 12 application and other function parameters the latter is required if the const link&, because the latter has declared that it does not change the original value P200 P377
Principles and Practice of C + + programming 17th part of the answer