fputc(0x0A,file)

This is a discussion on fputc(0x0A,file) within the C Programming forums, part of the General Programming Boards category; On windows, how can I write the (multi)char 0x0A (which is \n) without getting 0x0D 0x0A but only 0x0A eg ...

  1. #1
    Unregistered
    Guest

    fputc(0x0A,file)

    On windows, how can I write the (multi)char 0x0A (which is \n)
    without getting 0x0D 0x0A but only 0x0A eg 10 decimal ?

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    129
    If 0x0D is what I think it is - carriage return - try opening the file in binary mode.
    kooma - t.h@iki.fi

  3. #3
    B26354 Deckard's Avatar
    Join Date
    Jan 2002
    Posts
    633
    If fputc( 10, fptr ); does not work (and I suspect it will), this may be a 'feature' of the OS. Try your question on the Windows forum; I'll bet those guys will know the answer.
    Jason Deckard

Popular pages Recent additions subscribe to a feed

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