I’m just starting playing with some programming for OSX, and trying to create a simple command line app but I can’t seem to find a good guide. Basically I want to know how to get some user input for example ask the user their age etc.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’re in luck; OS X provides a manual page on all (nearly all?) standard C functions; the only trouble is knowing which function provides the services you’re looking for. The
fgets()function is probably best for reading a line-at-a-time. You’ll use it something like this:If you’re really looking for a tutorial, The C Programming Language is one of the finest possibilities. Be sure to get the second edition — a first edition might be entertaining, but the language has changed too drastically for it to be a reliable guide.
If you want a reference, then your manpages are the best source of information.