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?

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.

Similar Messages

  • Hello , how r u,  can i ask 1 question about xcode, i have mac os x 10.7.5 , n xcode version 4.6.3 i want build apps for ios 7.1 n mac os 1.9 ,, , but my macbook is old late 2008 macbook 4,1,  so can i develop apps for ios7 n 1.9 using xcode 4.6.3, bcz my

    hello , how r u,
    can i ask 1 question about xcode, i have mac os x 10.7.5 , n xcode version 4.6.3 i want build apps for ios 7.1 n mac os 1.9 ,, , but my macbook is old late 2008 macbook 4,1,  so can i develop apps for ios7 n 1.9 using xcode 4.6.3, bcz my machine cant upadte on 1.8 n 10.9,, ihave 2gb ram . core 2 duo pr, plz rely asap,
    thnxs

    Please type complete sentences and words.  This isn't an instant message program.
    https://developer.apple.com/support/ios/ios-dev-center.html

  • Is Mac Air 11 is good for Xcode

    Hi,
    I develop iOS apps using Mac mini connected to 22-inch LED, and I want to buy Mac Air 11 4GB-RAM as a portable machine and I want to use it for developing too.
    Is screen 11-inch is accepted for Xcode?
    Thanks

    Seems like it is.  Read what these users have to say: http://www.quora.com/Is-the-new-13-inch-MacBook-Air-capable-enough-for-iOS-devel opment

  • Hi all, i'm new and facing a problem while creating a new file for Xcode. I can't select the box "with XIB for user interface" if the subclass is "UIViewController".this problem happen after i upgrade Xcode to 4.6 version.Appreciate for any help rendered.

    Hi all, i'm new to Mac book & Xcode. I'm learning and facing problems while creating a new file for Xcode. Before i upgrade the software, i have no issue to create simple steps in apps. After upgrade Xcode to 4.6 version, i'm facing lot's of issue eg.
    1) "the identity "iphone developer" doesn't match any valid certificate/ private key pair",
    2) can't select the box "with XIB for user interface" if the subclass is "UIViewController"..
    Appreciate for any help rendered.

    Mikko777 wrote:So what is the best?
    I wouldn't judge. I've been to Arch for a week, you know? But as said, it's VERY close to it.
    What I dislike after a week is makepkg not handling dependencies automatically (which would be overhead, so probably not appropriate).
    Mikko777 wrote:Also theres KDEmod for modular kde, dunno if its for 64 bits tho.
    Don't actually need that as said ... I see no real benefit of having that other than not beeing a KDE user or having Gentoos useflags.
    Mikko777 wrote:PS:You produce a lot of text and welcome smile
    Yeah. Wonder why I'm still employed? So do I ...

  • Question about Xcode from experienced Mac users

    Hi,
    I am new to Macs.Recently I found an issues where the finder copy certain files such as .DS_Store whenever I access a network share. I tried to use a command through the terminal but it didn't work. I called apple to ask if there was any way I could view the value of the com.apple.desktopservices preference (sorry if this is not the name) and they told me to install Xcode so I could see it.
    I am a network engineer but I could like to know how I could get benefit from Xcode. What does it do? Is there a way to access the same information using terminal?
    I would like to learn a bit more about things that can be done using the command interface. I would appreciate if you send me some links or recommend any books (for simple stuff)
    Thanks in advance for your opinion.
    Macbook C2D   Mac OS X (10.4.8)  

    Hello and welcome to Mac.
    Your ".DS_Store" issue is not really an issue, OSX creates the file wherever it goes. You can remove existing .DS_Store files on a volume of your choosing with this Applescript:
    Click here to launch Script Editor.
    display dialog "When you delete .DS_Store files, you will lose window size and icon arrangement for EVERY FOLDER on the target disk. Furthermore, if you had any Spotlight comments (a.k.a.Finder comments) associated with any files, they'll also be deleted"
    set mountedDisk to POSIX path of (choose folder)
    tell application "Terminal"
    if (count of windows) is 0 then do script ""
    delay 0.1
    do script "find " & quoted form of mountedDisk & ¬
    " -name .DS_Store -delete" in front window
    end tell
    Everyone you talk to at Apple is an idiot, don't waste your time. Preference files are binary files for faster reading and writing by software. Xcode contains an application called "Property List Editor" that translates the plist files from and to editable XML files when you open them. Believe it or not, you can download the application from this page:
    http://Gnarlodious.com/Computer?action=AttachFile
    But there are ways to write the preference to the file without editing it. You can persistently disable the creation of the offending files with this Terminal command:
    defaults write com.apple.desktopservices DSDontWriteNetworkStores true
    As for Xcode, it is for programmers. There isn't much value in it for a sysadmin. Terminal, however, should become your main tool. You can convert a binary plist file to XML with this Terminal command:
    plutil -convert xml1 ~/Library/Preferences/com.apple.desktopservices.plist ; cat ~/Library/Preferences/com.apple.desktopservices.plist
    That is actually two commands, the first converts the file, the second writes it to the Terminal. After editing it, you would convert the same file to binary with this command:
    plutil -convert binary1 ~/Library/Preferences/com.apple.desktopservices.plist

  • How to enter a C EOF character in terminal

    I already searched and went to this thread here which has been archieved... http://discussions.apple.com/thread.jspa?messageID=5069197&#5069197
    It says EOF can be entered using ctrl-d but that doesn't seem to end the input stream. my code is as follows...
    #include<stdio.h>
    main()
    int c;
    while((c=getchar())!=EOF)
    putchar(c);
    any help is appreciated.
    PS: Referring to The C programming language, K&R
    Message was edited by: AceNeerav
    Message was edited by: AceNeerav

    First, and code you post should be wrapped in
    ... your code here ...
    tags. That will make sure the forum does not see coding syntax as forum formatting meta characters, and it will preserve your indentation.
    As the thread you posted suggests, there is no EOF character.
    However, at the lowest level the read() system call (somewhere under getchar()), can be told there is no more input, and it will return 0, which somewhere along the way, the getchar() code converts to EOF (where EOF is actually -1).
    Depending on what the read() system call is reading, there are different even lower level rules for indicating end-of-file. In your example, you are reading from the Terminal, and the tty driver (NOT the Terminal, but the tty driver) has the convention that if it is in the correct mode, it will tell the read() system call end-of-file when the tty driver sees a specific character.
    The normal Unix convention is that Control-D is used to indicate end-of-file. However, this can be changed (but normally it is not), or the tty driver can be put into "RAW" mode which will pass every character entered directly to the reading program and do nothing.
    You can see the current terminal driver settings using the
    stty all
    command. Here are the settings for my Terminal session:
    stty all
    speed 9600 baud; 13 rows; 145 columns;
    lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
    -echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo
    -extproc
    iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel iutf8
    -ignbrk brkint -inpck -ignpar -parmrk
    oflags: opost onlcr -oxtabs -onocr -onlret
    cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
    -dtrflow -mdmbuf
    discard dsusp eof eol eol2 erase intr kill lnext
    ^O ^Y ^D <undef> <undef> ^? ^C ^U ^V
    min quit reprint start status stop susp time werase
    1 ^ ^R ^Q ^T ^S ^Z 0 ^W
    Notice on the 4th from the bottom row, it says 'eof' and below that it says ^D (Control-D). This basically says that the tty driver will tell the read() system call end-of-file when the tty driver sees Control-D.
    Control-Z is used for job control, which suspends your current process and allows you to start a different job, optionally putting the current job in the background (Control-Z, jobs, bg and fg commands). Control-Z has nothing to do with end-of-file on a Unix based tty interface.
    However, I know that back in the good old days of DOS, a real Control-Z character in a text file WAS the end-of-file indicator. This was bad design even back then. Thankfully, Unix predated DOS and never used that ugly convention.
    As to your program, it works for me:
    #include<stdio.h>
    main()
    int c;
    while((c=getchar())!=EOF)
    putchar(c);
    I compiled and ran it:
    command prompt> gcc example.c -o example
    command prompt> example
    the quick brown fox jumps over the lazy dog # I typed this
    the quick brown fox jumps over the lazy dog # putchar() text
    ^D # I entered Control-D
    command prompt> # the program ends, and I get the command prompt
    If you are not seeing this behavior, then I would look closely at your stty settings.

  • I am using Xcode 5  on Mac Book with configuration Memory  5 GB 1067 MHz DDR3  and Processor  2.4 GHz Intel Core 2 Duo. It is getting hanged every time  whenever i work on Storyboard.  As my storyboard consists of 25 scenes. Please help I m suffering.

    I am using Xcode 5  on Mac Book with configuration Memory  5 GB 1067 MHz DDR3  and Processor  2.4 GHz Intel Core 2 Duo. It  hangs every time  whenever i work on Storyboard and even on clicking on any of the controller it takes time to open.  As my storyboard consists of 25 scenes. I searched a lot but did not get any results . I have upgraded my xcode to xcode 5.0.2  which is bug free as compare to xcode 5. Please help I m struggling with this problem a lot.

    iTunes for Mac
    http://support.apple.com/en-us/HT201693
    http://www.apple.com/itunes/download/
    Was it installed before? Does it show up in Software Update?
    Do other updates show up there (realizing that Lion is not getting all the updates anymore as it is no longer being supported).
    Apple Downloads
    - Always a place to manual download.
    MacBook Pro
    Mac OS X Lion System Communities

  • Keychain showing different character for the password

    Hi just wanted to ask why my keychain is showing different character for my password in my AIM and Yahoo account? When i mark the show password its show plenty of letters but not the one i am really using. How can i show the right one?

    Hi Irvin,
    If you see a crazy corrupt password, I'd delete that item, ythen login yo AIM or Yahoo again to create a new one, unless you don't remember your PW, then try Keychain First Aid under the Window Menu item, then either check the Password under that item, change it, or delete it and start over.
    Resetting your keychain in Mac OS X...
    If Keychain First Aid finds an issue that it cannot repair, or if you do not know your keychain password, you may need to reset your keychain.
    http://support.apple.com/kb/TS1544

  • Code for face recognition on mac osx using OpenCV

    Hi,
    I am writing a program for face detection on mac osx and I am using OpenCV. I am following the steps given on this link:
    http://iphone-cocoa-objectivec.blogspot.com/2009/01/using-opencv-for-mac-os-in-xcode.html
    There are three codes given for this program. The first code runs smoothly. In the second code there is no error in the compilation, it is successful. But it is not showing any output. As per the program it should open a new window. That window would store the picture taken from the camera.
    In the debugger console window the following error appears.
    OpenCV ERROR: Internal error (couldnt create new video channel)
    in function icvOpenCamera_QT, /Users/david/Work/Development/Net/opencv/xcode/../otherlibs/highgui/cvcap_qt.cpp(954)
    Terminating the application...
    /Users/david/Work/Development/Net/opencv/xcode/../cxcore/src/cxerror.cpp:360: failed assertion `0'
    Please help……
    Thanks and regards
    Prateek Chaubey

    I don't see what this has to do with Alchemy, or any Adobe product at all even!

  • Use external drive for both Time Machine and storage for Back to My Mac

    Hi all,
    I have been "a Mac" now for over a year and just keep finding cool new things that make me happy I switched. The latest thing is Back to My Mac offered with my Mobile Me account. With a rather convoluted mix of PC/Mac/iOS devices to manage - best $99 I ever spent btw...
    I also have a 1TB Time Capsule that I have been using with Time Machine to back up all four of my Mac computers at home. Needless to say, the 1TB is really struggling to handle the amount of data being backed up and certainly leaves no room for anything else.
    What I wanted to do was to attach a larger external hard drive via a powered hub to the USB port on the Time Capsule and use it for Time Machine backups while using the internal 1TB drive with Back to My Mac so that I can have remote access to all my data from anywhere without having to leave my computer running at home all the time in order for my laptop to "see" it when I'm away. And, yes, the amount of that data far exceeds what any level of Mobile Me subscription can offer! I should also mention that the hard drive is the only USB device connected through the hub to the Time Capsule at the moment. There are no other devices that might be "getting in the way".
    I'm thinking maybe all this is asking too much without the addition of a dedicated file server (Mac Mini, perhaps - not a purchase my budget wants to make).
    I understand that the Time Capsule doesn't support partitions, so I bought a Western Digital 2TB Elements drive, connected it to my Macbook Pro and used Disk Utility to reformat the drive from the incompatible NTFS it shipped in to a single, Mac OS Extended (Journaled) partition. I then made two folders on the drive, one for Time Machine backups and one for Back to My Mac remote storage/access. Great.
    However, when I connected the 2TB drive to my Time Capsule I could not see it at all. Time Capsule was reporting problems in the way of a disk error. From within my Airport Utility, I could see the trouble was the external drive. The utility suggested connecting the drive to a Mac and using it's Disk Utility to troubleshoot.
    I followed through, checking the disk, etc. and ended up reformatted the drive on my Macbook Pro yet again with the same specifications as before but without the folders and reconnected it to the Time Capsule. Same deal. But now, I can't even remotely connect to the Time Capsule at all. I can see the Time Capsule in the shared area of my Macbook's Finder but can not connect. The connection tries and fails even before it gets to asking me for username and password credentials.
    Long story short, first of all, I suppose I would like to know if I'm asking for the impossible?
    Second, if what I want to do *is* possible, what steps do I need to take to make it so?
    Thanks in advance for any advice or suggestions you might have.

    Well, I have now reformatted/partitioned my poor WD Elements 2TB drive about a dozen times as well as restarted my 1TB Time Capsule so many times it's no wonder it's as confused as I am! <G>
    Last night, at your suggestion, William, and in respect for your continued support, I tried creating two 1TB Mac OS Extended (Journaled) partitions on the WD external USB drive, both with GUID partition tables. Both volumes mounted to my laptop's desktop flawlessly and without issue.
    Once the external drive was connected to the Time Capsule, however, it was a crap shoot as to whether or not the drive was recognized at all, reporting a problem with the disk, or, even at one point, mounting one of the two volumes but not both. <sigh>
    I read somewhere on the Internet that you need to restart the Time Capsule for volumes on an external USB drive to be recognized.
    So I tried that. I connected the freshly partitioned/formatted disk to the Time Capsule and restarted it. This succeed in removing the issue of reporting a nameless drive with a capacity of 0MB. It then reported the drive with its correct name but would not recognize whatever volumes in whatever partitions that particular crack at it contained with the exception of the once, as I mentioned above, when only one of two volumes mounted correctly and was listed with the right name and capacity on the Time Capusule's Setup's Disk tab.
    At this point I have given up on my goal to use the external drive with Time Machine to back up my Macs or to hope I will ever be able to see its contents remotely via Back to My Mac. All I would like to do now is simply find a reason why I can't get it successfully connected and playing nice with my Time Capsule in the first place!
    Any further suggestions or advice as to what steps I might take next would be greatly appreciated.
    Thank you all.

  • Can i create mcx for shut down properly mac when battery is less 5 %

    Hi hello
    Can i create mcx for shut down properly mac when battery is less 5 % ?
    Thanks for your reply

    You can create a mailing list by using the "Groups" feature of Address Book. Simply select "New Group" from the File menu. Name the group, and drag the contacts you need into the group.
    In Mail, open up Preferences (under the Mail menu), and click on "Composing". Then make sure that "When sending to a group, show all member addresses" is unchecked.
    The auto reply is a feature that is better done on your mail server, as you Mac can only send an auto reply when it is on, with the Mail application open. If you use dot Mac, you can set up a vacation responder through the web, and you can leave your computer switched off.
    If you really want to leave your Mac on when you are on holiday, you can set up a mail rule (Preferences, Rules).

  • I have Photoshop Elements 12 for both PC and Mac (I use both). I have a new camera, Nikon D810. I downloaded the latest version of Camera Raw, 8.8. My D810 is listed as a supported camera model. However, when I try to open a raw photo in Photoshop Element

    I have Photoshop Elements 12 for both PC and Mac (I use both). I have a new camera, Nikon D810. I downloaded the latest version of Camera Raw, 8.8. My D810 is listed as a supported camera model. However, when I try to open a raw photo in Photoshop Elements, I keep getting the message "Could not complete your request because the file appears to be from a camera model which is not supported by the installed version of Camera Raw. I have tried reinstalling Camera Raw many times, and have tried to open many different raw files in Elements, and still get the same error message. Please help.

    How did you try to install ACR 8.8.  The only way I know of that works with Elements is to use the Updates Choice on the Help menu.
    There are two charts supplied by Adobe that explain your RAW dilemma.  This one tells you what your camera needs:  http://helpx.adobe.com/creative-suite/kb/camera-raw-plug-supported-cameras.html   This one tells you what version of software you need:  http://helpx.adobe.com/x-productkb/global/camera-raw-compatible-applications.html
    In your case, the Nikon D810 needs Adobe Camera Raw (ACR) 8.6 or Lightroom 5.6.  (Congratulations on buying a new camera!)
    To get to that level with Photoshop Elements, you will need to replace your Photoshop Elements 12 with version 13.   Adobe caps ACR updates on version 12 at 8.5.
    The most convenient way to get around it without spending any money is to use the FREE from Adobe DNG Converter.  Download and install it from here for FREE:  http://www.adobe.com/support/downloads/thankyou.jsp?ftpID=5855&fileID=5890  Once it is installed you can convert your D810 raw files to an Adobe RAW version with the .DNG file extension that most, if not all, versions of the various Adobe software programs can use.  That includes old versions of Photoshop, Elements and Lightroom.  DNG converter can be used as the tool to move your files from your memory card to your computer, is efficient, will convert in batches and is completely lossless.  There is no risk of any image quality degradation or RAW functionality.

  • I have an external hard drive that was formatted by a PC and has files and directories etc. I want to format it and use it on my IMAC for backup but I can't seem to write to it nor can I delete current content. How do I initialize it for use with the MAC?

    I have an external hard drive that was formatted by a PC and has files and directories copied to it etc. I want to use it on my IMAC for backup. I see it on my my IMAC . I can open files etc.  But I can't seem to write to it nor can I delete current content. I don't care if I lose current content. How do I initialize it for use with the MAC?

    You can't write to it because it's formatted as NTFS which OS X will read but not write to. If you want to continue using the drive with both a PC and OS X you will need to download and install NTFS-3G so you can then write to it from your Mac. You can get NTFS-3G at:
    http://www.macupdate.com/app/mac/24481/ntfs-3g
    If you want to use the drive exclusively with your Mac then move the data off it and reformat it in Disk Utility (Applications - Utilities - Disk Utilities) as Mac OS Extended (Journaled.)

  • I recently purchase an ipad2.  I also have a mac laptop.  Now, when I facetime call using my iphone to my ipad2 or mac, it states busy.  how can i fix this problem?  I have the same apple id e mail for both ipad2 and mac.  it might be getting confuse now.

    I recently purchase an ipad2.  I also have a mac laptop.  Now, when I facetime call using my iphone to my ipad2 or mac, it states busy.  how can i fix this problem?  I have the same apple id e mail for both ipad2 and mac.  it might be getting confuse now.  I want to be able to face time also using my ipad2 to my laptop especially if one of the members of the family is traveling.  Thanks.

    thanks.  your answer was correct, clearer.  I have another question, maybe you can answer.  I just purchase my ipad2 2 days ago.  yesterday, there was a sound.  today there is no sound.  there is a sound only in movies and you tube and music.  but no sound on all apps and keyboards.  I look it up and seems like ther are few that have this problem.  I called walmart coz I bought it there and they told me that they have not heard that before but if I can't fix it, just return it and exchange it with anew one since I have 14 days to do that.  I tried rebooting it and still won't work.  Should I just restore it?

  • Can I use one external hard drive for 3 of my Macs?

    I have a 2007 white MacBook, a 2011 MacBook Pro, and a 2013 MacBook Air.
    I want to be able to transfer all of my precious family photos off of my MacBook and Macbook Pro onto an external hard drive and then wipe those computers clean, and then I want to be able to backup and wipe clean my Macbook Air so that I can update it to Mavericks.
    Can I use one external hard drive to do this for three of my Macs? Will it be compatible with all of them? And will I still be able to use the hard drive with my Air once it is updated to Mavericks?
    Which hard drive do you recommend?

    1. Yes. Note that anything you want to keep should be on at least two drives in case one of them fails.
    2. Yes.
    3. Yes.
    (110959)

Maybe you are looking for