Hi All
I've used UNIX in the past experimenting with commands through terminal but thats about it. Im now currently teaching myself "C".
Using a book from the library, the first chapter asks you run and compile your program from a command-line prompt. As you will see the program is very simple, please see below, but I am scratching my head as to why there is any problem with this when running this through UNIX. I coded the below with a textEdit and I am also using Xcode and it builds succesfully, but when I put it through UNIX I get the following
./hello.c: line 3: syntax error near unexpected token `('
./hello.c: line 3: `int main (void)'
I have searched your forums and Google and although there is much regarding the title, none covers something so simple as this one. I would very much appreciate if you could advice me what this is?
Many thanks for your time and reading,
Camzio
Quote:
#include <stdio.h>
int main (void)
{
printf ("Hello World!");
return 0;
}