Once you have followed Jeffrey's advice, you will need the following:
int main(int argc, char * argv)
#include <stdlib.h> not needed for printf, but just good
a good practice to get into adding it to include list.
The stuff within the parenthesis in int main(int argc, char * argv)
is also not needed/required unless the function will have command line
arguments. (void) is sufficient in this case.
Ran the code just as he had it on my system without issue.
His issue is an incomplete or bad install of Xcode.
Currently Being ModeratedDec 29, 2012 10:47 AM (in response to johnfromgilroy)
Two thoughts to help you ...
There is an excellent (in my not-so-humble-but-so-what opinion) book for C. "The C Programming Language" written by Dennis Ritchie and Brian Kernighan (the authors of C), ISBN 0-13-110362-8. $45 on Amazon, $60 through bookstores. Excellent refrence for C.
It will also explain why these two declarations of "main" are both valid:
main (int argc, char *argv)
main (int argc, char **argv)
It is sad that the newer ones are 50% fatter because the page-stock is heavier.
Or maybe that thin page stock is the reason for yours falling apart.
Mine is very close to losing pages and needing replacement ...