Code:
main() { char string1[10],string2[10],string3[10]; int x,count; cout<<"ENTER TEXT TO COMPACT:"; cin>>string1; count=strlen(string1); for(int x=0; x<count; x++) //Check whether x is a multiple of 2 if(x%2 == 0) { string2[x/2] = string1[x]; } else { string3[x/2] = string1[x]; } cout<<string2<<endl; getche(); }
i did that but still it onlyy works to text with 4 characters above....
i couldn't figure out what to do...
Comment