How this program works to remove the white-space?:
int main()
{
char s[]="remove white space";
int i;
for(i=0;s[i];++i)
if(s[i]==' ')
s[i]='\a';
printf("%s",s);
return 0;
}
See output here
Output:
removewhitespace
It’s not removing the whitespace, it’s just replacing it with the bell character, which isn’t printed by most terminals (instead, they usually produce a fastidious beep).
Although invisible on a terminal, those characters are obviously written on the standard output, so if you redirect to file the output of your program they will be written to disk, and can be displayed with most editors.