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 ??
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..?