0

Can someone help me with this question ?? It’s in C++

given a string convert it to upper case using pointer notation char s[200]; char *sp=s; cin>>s; //or cin>>sp; for(;*sp;sp++){ if(*sp>='a'&& *sp<='z') *sp-=32; } cout<<s; //or sp=s; cout<<sp; //what is the output of the following? cout<<sp-s; //the length of the string copy char array to another char array ??? How can I do the copying ??

28th Sep 2020, 11:05 AM
Aya Dmaidi
Aya Dmaidi - avatar
1 Answer
0
for(i=0; i<sp-s;i++) s1[i] = s[i]; s1[i]='\0'; cout<<s1; Declare I first. Is this what you looking..?
28th Sep 2020, 11:22 AM
Jayakrishna šŸ‡®šŸ‡³