CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2002
    Posts
    5,757

    Using Delimiter EOF :: C++

    Hi.

    I am working on a small practice program for a C++ class. I need to implement a way to delimite using EOF. The user can break out of a while, for example, with ctrl-d (dos) or ctrl-z (unix).

    What is the best way to implement something like that?

    I have tried this:

    while((num = cin.get()) != EOF) // from Deitel
    {}

    The above does not work.

    Thanks,
    Kuphryn


  2. #2
    Join Date
    Oct 2000
    Location
    London, England
    Posts
    4,773

    Re: Using Delimiter EOF :: C++

    breaking out in UNIX with Ctrl-Z is a feature of the operating system, not of the program.




    The best things come to those who rate

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured