Thread: Difference between EOF and EOL

  1. #1
    Registered User
    Join Date
    Nov 2012
    Posts
    4

    Question Difference between EOF and EOL

    I'm new learner of C, Can some body please explain me the difference between EOF & EOF. I wanna know the use of these calls as well. Thank You.
    Last edited by Salem; 11-17-2012 at 09:25 AM. Reason: removed pointless font size and colour

  2. #2
    Registered User
    Join Date
    Sep 2012
    Posts
    357
    EOF is a macro defined in <stdio.h> with int type and a negative value. It is used to detect errors in I/O operations.
    EOL is not defined by either the C Standard or POSIX. Where did you learn about it?

    The value '\n', when read or wriiten with <stdio.h> functions for files opened in text mode (no 'b' in the mode string) is automatically translated to whatever is appropriate for the OS where the code is running: "\n" for Linux, "\r\n" for Windows, "\n\r" for very old Mac, ...

  3. #3
    Registered User
    Join Date
    Nov 2012
    Posts
    4
    Quote Originally Posted by qny View Post
    EOF is a macro defined in <stdio.h> with int type and a negative value. It is used to detect errors in I/O operations.
    EOL is not defined by either the C Standard or POSIX. Where did you learn about it?

    The value '\n', when read or wriiten with <stdio.h> functions for files opened in text mode (no 'b' in the mode string) is automatically translated to whatever is appropriate for the OS where the code is running: "\n" for Linux, "\r\n" for Windows, "\n\r" for very old Mac, ...
    Thank You So Much
    I have to make a program, it has integer values to input & to terminate the input,I have to use EOF.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. what is the difference between them..
    By transgalactic2 in forum C Programming
    Replies: 9
    Last Post: 03-19-2009, 01:27 PM
  2. difference
    By srinu in forum Windows Programming
    Replies: 2
    Last Post: 02-13-2003, 04:19 PM
  3. What's the difference?
    By electrolove in forum C Programming
    Replies: 2
    Last Post: 02-12-2003, 02:31 AM
  4. Difference of RAM
    By windoze victim in forum Tech Board
    Replies: 25
    Last Post: 01-30-2003, 05:33 PM
  5. what's the difference of them ???
    By black in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 08-14-2002, 09:50 AM