A program with variables

Back in Xcode, you are going to create another project. First, close the AGoodStart project so that you do not accidentally type new code into the old project.

Now create a new project (FileNewProject...). This project will be a C Command Line Tool named Turkey.

In the project navigator, find this project’s main.c file and open it. Edit main.c so that it matches the following code.

#​i​n​c​l​u​d​e​ ​<​s​t​d​i​o​.​h​>​

i​n​t​ ​m​a​i​n​ ​(​i​n​t​ ​a​r​g​c​,​ ​c​o​n​s​t​ ​c​h​a​r​ ​*​ ​a​r​g​v​[​]​)​
{​
 ​ ​ ​ ​/​/​ ​D​e​c​l​a​r​e​ ​t​h​e​ ​v​a​r​i​a​b​l​e​ ​c​a​l​l​e​d​ ​'​w​e​i​g​h​t​'​ ​o​f​ ​t​y​p​e​ ​f​l​o​a​t​ ​ ​ ​ ​f​l​o​a​t​ ​w​e​i​g​h​t​;​ ​ ​ ​ ​/​/​ ​S​t​o​r​e​ ​a​ ​n​u​m​b​e​r​ ​i​n​ ​t​h​a​t​ ...

Get Objective-C Programming: The Big Nerd Ranch Guide 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.