Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In Xcode, create yet another new project: a C Command Line Tool named Coolness.
The first program I ever wrote printed the words, “Aaron is Cool”. (I was 10 at the time.) Write that program now:
#include <stdio.h>
int main(int argc, const char * argv[])
{
printf("Aaron is Cool\n");
return 0;
}
Build and run the program.
Let’s suppose for a moment that you could make my 10-year-old self feel more confident if the program printed the affirmation a dozen times. How would you do that?
Here’s the dumb way:
#include <stdio.h>
int main(int argc, const char * argv[])
{
printf("Aaron is Cool\n");
printf("Aaron is Cool\n");
printf("Aaron is Cool\n");
printf("Aaron is Cool\n");
printf("Aaron is Cool\n");
printf("Aaron is Cool\n");
printf("Aaron is Cool\n");
printf("Aaron is Cool\n");
printf("Aaron is Cool\n");
printf("Aaron is Cool\n");
printf("Aaron is Cool\n");
printf("Aaron is Cool\n");
return 0;
}