string str;
int k=0, count = 0,namelength, size,j=0;
char name[80];
char extract[80];
char reversing[80];
cout << "Enter word or enter 'Q' to quit." << endl;
cout << ">>";
cin.get(name,80);
size =strlen(name);
int q=0;
for(int i=0;i<=size;i++){
if(isalnum(name[i])){
name[q]=name[i];
q++;
}else{
name[i]= '\0';
}
cout << name[i];
/*line start here when removing the null spaces*/
if(name[i] == '\0'){
name[k]=name[i];
k++;
cout << name[k];
}
}
But it doesn't work. So how?