Skip to Main Content
Xcode 5 Start to Finish: iOS and OS X Development
book

Xcode 5 Start to Finish: iOS and OS X Development

by Fritz Anderson
May 2014
Intermediate to advanced content levelIntermediate to advanced
624 pages
19h 43m
English
Addison-Wesley Professional
Content preview from Xcode 5 Start to Finish: iOS and OS X Development

Compiling

Fortunately, you have a computer to keep track of such things. A compiler is a program that takes source files and generates the corresponding streams of machine-level instructions. Consider this function, that calculates two averages and sends them back to the caller through a results struct:

void calculate_stats(Results * results){    int     n = 0, nScanned = 0;    double  sum_X, sum_Y;    sum_X = sum_Y = 0.0;    do {        double      x, y;        nScanned = scanf("%lg %lg", &x, &y);        if (nScanned == 2) {            n++;            sum_X += x;            sum_Y += y;        }    } while (nScanned == 2);    Results     lclResults = { .avg_X = sum_X/n#if CALCULATE_AVG_Y        , .avg_Y = sum_Y/n ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Xcode 6 Start to Finish: iOS and OS X Development, Second Edition

Xcode 6 Start to Finish: iOS and OS X Development, Second Edition

Fritz Anderson
Objective-C for Absolute Beginners: iPhone, iPad and Mac Programming Made Easy

Objective-C for Absolute Beginners: iPhone, iPad and Mac Programming Made Easy

Stefan Kaczmarek, Brad Lees, Gary Bennett, Mitch Fisher

Publisher Resources

ISBN: 9780133751031Purchase book