I don't know if this is the right forum for this particular problem, but I'm sure somebody will put me right if it isn't
I'm trying to follow the 'Program in C' series which started in issue 17, but I've fallen over at the first hurdle.
I've entered the 'Hello world' listing in Gedit; -
01. #include <stdio.h>
02.
03. /***********************************
04. * Main function gets called when *
05. * the application is launched *
06. ***********************************/
07. int main()
08. {
09. // Say something to the audience
10. printf("Hello world\n");
11. return 0;
12. }
I can't see anything wrong with what I've typed in, but when I try to compile it, I get the following error messages;-
john@john-desktop:~$ gcc -Wall -W -Werror c-try.c -o c-try
c-try.c:1: error: expected identifier or ‘(’ before numeric constant
c-try.c:1: error: stray ‘#’ in program
john@john-desktop:~$
Out of interest, I installed Anjuta and tried compiling the listing in it; I got the same errors, so presumably there is something wrong with the program I'm trying to compile.
Can anybody help, please. I'm not new to programming, but this has got me beat.
Thanks,
John
Bookmarks