Command-Line Arguments

Often a program is developed that requires the user to enter a small amount of information at the terminal. This information might consist of a number indicating the triangular number you want to have calculated or a word you want to have looked up in a dictionary.

Instead of having the program request this type of information from the user, you can supply the information to the program at the time the program is executed. Command-line arguments provide this capability.

We have pointed out that the only distinguishing quality of the function main is that its name is special; it specifies where program execution is to begin. In fact, the runtime system actually calls upon the function main at the start of program execution, ...

Get Programming in Objective-C, Sixth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.