Alright im new to both C and xcode right now, im looking for a bit of help.
Im trying to learn C right now using "the C programming language" book. I am trying to work though the examples, and im still trying to work out the kinks before I really get into it.
when I open a new project and use the standard tool it offers this code for the hello world program
this works fine and builds with no warnings, however when I try the example in the book im learning from, written by the people who made the language, I get errors during the build
now from a programming point of view I understand what the errors are telling me. My question is why does xcode seems to be using different rules while compiling then what I am expecting to see, and whats in the book?
Also iv noticed both these programs will print if i open them in "console", and it will also run with the same result if I remove the \n, which I definitely cant explain.
Im trying to learn C right now using "the C programming language" book. I am trying to work though the examples, and im still trying to work out the kinks before I really get into it.
when I open a new project and use the standard tool it offers this code for the hello world program
Code:
#include <stdio.h>
int main ()
{
printf("Hello, World!");
return 0;
}
this works fine and builds with no warnings, however when I try the example in the book im learning from, written by the people who made the language, I get errors during the build
Code:
#include <stdio.h>
main ()
{
printf("Hello, World!");
}
now from a programming point of view I understand what the errors are telling me. My question is why does xcode seems to be using different rules while compiling then what I am expecting to see, and whats in the book?
Also iv noticed both these programs will print if i open them in "console", and it will also run with the same result if I remove the \n, which I definitely cant explain.