the input provided through temp is a sentence, and I need to remove spaces and special characters but 'mes' stores only the first word
#include <iostream>
#include <cmath>
using namespace std;
int main(){
char mes[51];
char pas[11];
char tem[51];
cin.getline(tem,51);
cin.getline(pas,11);
for(int i=0;i<51;i++){
mes[i]='\0';
}
for(int t=0;t<sizeof(pas);t++){
pas[t]=tolower(pas[t]);
}
for (int i=0;i<50;i++){
char c=tem[i];
int ch=(int)c;
if(( ch >= 65 && ch <= 90) || ( ch >= 97 && ch <= 122)){
if( ch >= 65 && ch <= 90)
ch+=32;
mes[i]=(char)ch;
}
else
continue;
}
cout<<mes<<endl;