EOF Char

This is a discussion on EOF Char within the Windows Programming forums, part of the Platform Specific Boards category; hi all , back once again . well i am writting a protocol analyser and i have a file where ...

  1. #1
    vickys
    Guest

    Unhappy EOF Char

    hi all ,
    back once again .
    well i am writting a protocol analyser and
    i have a file where there is an EOF file character probably in the file like ""



    Data Follows

    2˙SMBsČ˙žH ˙2
    ®Ō€÷NTLMSSPn†

    @J



    now when i am reading the file with fgets or file.readstring or whatever .... the file is closed at this point "" because of the eof file character ... could any one please tell me how do i avoid my program to read it lamelly without treating as a "EOF" rather as a character and moreover i believe it's ascii value is somewhere less then 0 or 0 to be exact ..now how do i rectify it .


    thanx

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    If you opened the file with CreateFile(), then use GetFileSize(), allocate memory for this size and read the whole file to the memory block with ReadFile().

    If using fopen(), are you opening a binary file in text mode, or text file in binary mode, as that may be your problem.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  3. #3
    vicks
    Guest
    thanx a zillion tons ..dude

    love you
    vicks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. seg fault at vectornew
    By tytelizgal in forum C Programming
    Replies: 2
    Last Post: 10-25-2008, 01:22 PM
  2. Replies: 12
    Last Post: 08-11-2008, 11:02 PM
  3. Passing structures... I can't get it right.
    By j0hnb in forum C Programming
    Replies: 6
    Last Post: 01-26-2003, 10:55 AM
  4. How do you search & sort an array?
    By sketchit in forum C Programming
    Replies: 30
    Last Post: 11-03-2001, 04:26 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21