Programming in Objective-C, Third Edition (PATRICIA BLAIR's Library) by Stephen G. Kochan

Programming in Objective-C, Third Edition (PATRICIA BLAIR's Library) by Stephen G. Kochan

Author:Stephen G. Kochan
Language: eng
Format: epub
Publisher: Addison-Wesley
Published: 2011-03-05T16:00:00+00:00


* * *

#import <Foundation/Foundation.h>

void printMessage (void)

{

NSLog (@"Programming is fun.");

}

int main (int argc, char *argv[])

{

NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

printMessage ();

[pool drain];

return 0;

}

* * *

Program 13.3. Output

* * *

Programming is fun.

* * *

Program 13.3 consists of two functions: printMessage and main. As mentioned earlier, the idea of calling a function is not new. Because printMessage takes no arguments, you call it simply by listing its name followed by a pair of open and close parentheses.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.