yes but that should be copy the index which isn't space or tab but see now i changed to use index array members rather than addresses it worked fine i want to know why ?
#include <stdio.h>
#include <ctype.h>
#define STOP -1
int GetLine(char *SzBuff) {
int i=0;
char c;
for( i=0;(c=getchar())!='\n';i++) {
SzBuff[i]=c;
if(c==EOF) {
SzBuff[i]='\0';
return -1;
}
}
SzBuff[i]='\0';
return i;
}
int IsDel(char c) {
if(c==' ' || c=='\t') return 1;
return 0;
}
void RemoveBlanks(char * SzString) {
int j=0;
for(int i=0;SzString[i]!=0;i++)
if(!IsDel(SzString[i]))
SzString[j++]=SzString[i];
SzString[j]='\0';
return;
}
int main(void)
{
char SzName[100];
while(GetLine(SzName)!=STOP) {
RemoveBlanks(SzName);
if(SzName[0]=='\0')//skip blank lines
continue;
puts(SzName);
}
return 0;
}