Thread: EOF Char

  1. #1

    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


    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 how do i rectify it .


  2. #2
    train spotter
    Join Date
    Aug 2001
    near a computer
    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
    thanx a zillion tons ..dude

    love you

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, 11:55 AM
  4. How do you search & sort an array?
    By sketchit in forum C Programming
    Replies: 30
    Last Post: 11-03-2001, 05:26 PM