EOF Character for XCode on a Mac

I am a teacher that is currently teaching programming in C++ for a high school class. I used to use CodeWarrior and now I am using XCode. One of the programs that my students have to write is waiting for an End Of File character to quit the program. What combination is this for the Mac? In Windows, it is ctrl-z. In UNIX it is supposedly ctrl-d. I thought the UNIX one would work, but it does not. Does any one have an idea of what key combination to use for the EOF?

eMac, Mac OS X (10.4.5)

Posted on Feb 27, 2006 10:41 AM

Reply
Question marked as Top-ranking reply

Posted on Feb 27, 2006 11:46 AM

Aaaah. The perennial EOF question again. I think you are assuming that the run console in Xcode is a full-on Unix shell environment. It is not.

But ctrl-D works admirably as EOF for any Unix command-line app built with Xcode that expects an EOF to end data input. If you run it in a Unix shell.

Don't feel bad. This is not particularly well documented as such. Even if they documented it really well, you would never be able to find it amid all the other documentation without knowing what to search for. Xcode is not Unix. Heck, in OS X, even Unix is not Unix. But by golly, the EOF part works.
2 replies
Question marked as Top-ranking reply

Feb 27, 2006 11:46 AM in response to George Ansell

Aaaah. The perennial EOF question again. I think you are assuming that the run console in Xcode is a full-on Unix shell environment. It is not.

But ctrl-D works admirably as EOF for any Unix command-line app built with Xcode that expects an EOF to end data input. If you run it in a Unix shell.

Don't feel bad. This is not particularly well documented as such. Even if they documented it really well, you would never be able to find it amid all the other documentation without knowing what to search for. Xcode is not Unix. Heck, in OS X, even Unix is not Unix. But by golly, the EOF part works.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

EOF Character for XCode on a Mac

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.