How could i find the '\t' in a file [modified]
-
I am wondering who can help me. if((fp=fopen("E456.cpp","r"))!=NULL) { while(!feof(fp)) { int i=0; char ch; while((ch=fgetc(fp))!='\n' && ch!=EOF) buff[i++]=ch; ::TextOut(hdc,cx,cy*nLineNumber,buff,i); nLineNumber++; } fclose(fp); } The above is my code ,I want to find the '\t',and then i can print the file content out with some space.but i just can't.Where is the key? Is there are some people to help me?
modified on Saturday, February 21, 2009 10:26 PM
-
I am wondering who can help me. if((fp=fopen("E456.cpp","r"))!=NULL) { while(!feof(fp)) { int i=0; char ch; while((ch=fgetc(fp))!='\n' && ch!=EOF) buff[i++]=ch; ::TextOut(hdc,cx,cy*nLineNumber,buff,i); nLineNumber++; } fclose(fp); } The above is my code ,I want to find the '\t',and then i can print the file content out with some space.but i just can't.Where is the key? Is there are some people to help me?
modified on Saturday, February 21, 2009 10:26 PM
if (ch == '\t') { buff[i++] = ' '; buff[i++] = ' '; buff[i++] = ' '; buff[i++] = ' '; }
«_Superman_» I love work. It gives me something to do between weekends.
-
if (ch == '\t') { buff[i++] = ' '; buff[i++] = ' '; buff[i++] = ' '; buff[i++] = ' '; }
«_Superman_» I love work. It gives me something to do between weekends.