来一段C的代码:
#include
int main()
{ char *p,*q,s[100]="Abcd\nEfgh\nIjklmn\nOpqrst";
printf("原来的字符串:\n%s\n",s);
p=q=s;
do
{if(*p!='\n')*q++=*p;
p++;
}while(*p);
printf("删除后的字符串:\n%s\n",s);
return 0;
}