Thread: Eof

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    9

    Post Eof

    Hi there. I'm a bit confussed. Theoretically i know what's the meaning of EOF but practically not really. So, have a text that i read with getchat and in an IF structure have the condition (c=getchar)!=EOF. The program doesn't finish untile i break it by myself. how does the program know when to stop? what if i want to stop when i'm done with the text i want to input?
    Thanks.

  2. #2
    Registered User datainjector's Avatar
    Join Date
    Mar 2002
    Posts
    356
    On unix like systems the EOF indicator is entered by typing the sequence

    <return> <ctrl-d>
    on system like VAX VMS, DOS and windows use
    <ctrl-z>
    "I wish i could wish my wishs away"

    "By indirections find directions out" -- William Shakespears

    "Do what thou wilt shall be the whole of the law" -- Crowley "THE BEAST 666"

    Mizra -> love = Death...
    RDB(Rocks yooo)..

    http://www.cbeginnersunited.com

    Are you ready for the Trix ???

  3. #3
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    F6 works as well in DOS

    The EOF is a signal your operating system sends the program to tell it that the file is done. If you redirect your input from a file, the EOF should occur eventually. Same if you input from a FILE *. The exception is when you type into standard input.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. EOF Explanation Anybody?
    By blackcell in forum C Programming
    Replies: 1
    Last Post: 01-29-2008, 09:09 PM
  2. EOF or not EOF?
    By CornedBee in forum Linux Programming
    Replies: 2
    Last Post: 09-14-2007, 02:25 PM
  3. EOF messing up my input stream?
    By Decrypt in forum C++ Programming
    Replies: 4
    Last Post: 09-30-2005, 03:00 PM
  4. whats the deal with EOF really ???
    By gemini_shooter in forum C Programming
    Replies: 7
    Last Post: 03-06-2005, 04:04 PM
  5. files won't stop being read!!!
    By jverkoey in forum C++ Programming
    Replies: 15
    Last Post: 04-10-2003, 05:28 AM