Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How could i find the '\t' in a file [modified]

How could i find the '\t' in a file [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Archy_Yu
    wrote on last edited by
    #1

    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

    _ 1 Reply Last reply
    0
    • A Archy_Yu

      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

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      if (ch == '\t') { buff[i++] = ' '; buff[i++] = ' '; buff[i++] = ' '; buff[i++] = ' '; }

      «_Superman_» I love work. It gives me something to do between weekends.

      A 1 Reply Last reply
      0
      • _ _Superman_

        if (ch == '\t') { buff[i++] = ' '; buff[i++] = ' '; buff[i++] = ' '; buff[i++] = ' '; }

        «_Superman_» I love work. It gives me something to do between weekends.

        A Offline
        A Offline
        Archy_Yu
        wrote on last edited by
        #3

        Thank you very much,You are very friendly,and helpful. :laugh:

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups