- Full Description
Considered a classic by an entire generation of Mac programmers, this popular guide has been updated for Mac OS X. Dont know anything about programming? No problem! Acclaimed author Dave Mark starts out with the basics and takes you through a complete course in programming C using Apples free Xcode tools. This book is perfect for beginners learning to program. It includes Mac OS X examples!
- Provides best practices for programming newbies
- Written by the expert on Cprogramming for the Mac
- Presents all the basics with a pragmatic, Mac OS X-flavored approach
- Includes updated source code which is fully compatible with Xcode 4
What youll learn
- Master C programming, the gateway to programming your Mac or iPhone
- Write applications for the Mac OS X interface, the cleanest user interface around
- Understand variables and how to design your own data structures
- Work with the file system
- Connect to data sources and the Internet
Who this book is for
For anyone wanting to learn to program in Mac OS X, including developers new to the Mac, developers new to C, or students entirely new to programming. For anyone who wants to learn how to program their iPhone, this is also the core language primer.
- Source Code/Downloads
If you think that you've found an error in this book, please let us know about it. You will find any confirmed erratum below, so you can check if your concern has already been addressed.On page 5:
The tools are not free when going through http://developer.apple.com/mac
On page 62:
The line of code
myInt = 27 * 6 % 5
should have its operators evaluated left to right, but the example reverses this order.
The equivalent code is actually
myInt = (27 * 6) % 5
The following line of code
myInt = 27 % 6 * 5
should also have its operators evaluated left to right, but the example reverses the order here too.
The equivalent code is actually
myInt = (27 % 6) * 5
On page 92:Just checking whether, at the top of the page, it is supposed to say ' ! mySecondInt ', rather than ' ! mySecondBool '...?
On page 93:Rather than use bool, use:
int nothingElseOn, itsARerun;
nothingElseOn = true; itsARerun = false;
if ( (! itsARerun) || nothingElseOn ) printf( "Let's watch Family Guy!\n" );
printf( "Something else is on or I've seen this one.\n" );
On page 199:Isspace().....returns 0 if the char is either a tab....
It's the contrary, isspace() returns 1 if the char is a tab or space or line feed or....
On page 222:The semicolon is missing after the right curly brace in the type declaration.
On page 226:Under "NOTE" author has written the three fields "total 103 bytes" -- should read "total 513 bytes".
On page 236:
At the end of sample type declaration under "Creating a Linked List" the semicolon is missing after the right curly brace.
On page 254:
From the grey box at the top:
As long as the type of the right side is no larger than the type of the left side (as is the case here: an int is at least as large as a char), this won’t be a problem.
This doesn't make sense since the return type of fgetc is an int, which is larger than the char it is getting assigned to, so the type of the right side is larger than the type on the left side.