Re: Hello World doesn't work

1998-11-30 Thread Brian May
Hmmm. I was told that 'int func(void)' means it takes no parameters, while 'int func()' means it could take any. As silly as it seems, I think this is part of the ANSI C standard (to allow for older programming styles). Otherwise, there would never have been any need for 'int func(void)'. I

Hello World doesn't work

1998-11-28 Thread Kent West
Hey all! I've decided to get my feet wet with C programming on Linux. I've got two machines running Debian (hamm). On both, I've created a simple C program (named bub.c) like so: main() { printf(Howdy, World!\n); } and compiled it with: gcc -o bub bub.c When I run ./bub on the

Re: Hello World doesn't work

1998-11-28 Thread Havoc Pennington
On Fri, 27 Nov 1998, Kent West wrote: main() A long shot, but technically the above is illegal; you have to do: int main(int argc, char* argv[]) then return something from main, or call exit(). maybe the lack of a return or exit call from main prevents the io buffers from getting flushed?

Re: Hello World doesn't work

1998-11-28 Thread aqy6633
main() { printf(Howdy, World!\n); } I would sugest putting the following line before main() #includestdio.h Alex Y. -- _ _( )_ ( (o___ +---+ | _ 7 |Alexander Yukhimets| \()

Re: Hello World doesn't work

1998-11-28 Thread Ole J. Tetlie
*-Havoc Pennington [EMAIL PROTECTED] | | On Fri, 27 Nov 1998, Kent West wrote: | |main() | | A long shot, but technically the above is illegal; you have to do: | int main(int argc, char* argv[]) It can also be 'int main(void)', which is equivalent to 'main()'. | then return something from

Re: Hello World doesn't work

1998-11-28 Thread M.C. Vernon
On Fri, 27 Nov 1998, Kent West wrote: Hey all! I've decided to get my feet wet with C programming on Linux. I've got two machines running Debian (hamm). On both, I've created a simple C program (named bub.c) like so: You need to #includestdio.h man 3 printf will show you this.

Re: Hello World doesn't work

1998-11-28 Thread M.C. Vernon
On Fri, 27 Nov 1998, Havoc Pennington wrote: On Fri, 27 Nov 1998, Kent West wrote: main() A long shot, but technically the above is illegal; you have to do: int main(int argc, char* argv[]) int main(void) is also correct, and until ANSI C90 comes out, main() will do. then return

Re: Hello World doesn't work

1998-11-28 Thread Havoc Pennington
On Sat, 28 Nov 1998, M.C. Vernon wrote: int main(void) is also correct, and until ANSI C90 comes out, main() will do. You're right, I'm a dork, or at least my memory is foggy :-) then return something from main, or call exit(). maybe the lack of a return or exit call from main

Re: Hello World doesn't work

1998-11-28 Thread Hamish Moffatt
On Sat, Nov 28, 1998 at 09:03:39AM +0100, Ole J. Tetlie wrote: It can also be 'int main(void)', which is equivalent to 'main()'. Hmmm. I was told that 'int func(void)' means it takes no parameters, while 'int func()' means it could take any. Some example source is below. gcc complains about the

Re: Hello World doesn't work

1998-11-28 Thread Wojciech Zabolotny
On Sat, 28 Nov 1998, Hamish Moffatt wrote: On Sat, Nov 28, 1998 at 09:03:39AM +0100, Ole J. Tetlie wrote: It can also be 'int main(void)', which is equivalent to 'main()'. Hmmm. I was told that 'int func(void)' means it takes no parameters, while 'int func()' means it could take any.

Re: Hello World doesn't work

1998-11-28 Thread M.C. Vernon
On Sat, 28 Nov 1998, Hamish Moffatt wrote: On Sat, Nov 28, 1998 at 09:03:39AM +0100, Ole J. Tetlie wrote: It can also be 'int main(void)', which is equivalent to 'main()'. Hmmm. I was told that 'int func(void)' means it takes no parameters, while 'int func()' means it could take any. So

Re: Hello World doesn't work

1998-11-28 Thread Ole J. Tetlie
*-Hamish Moffatt [EMAIL PROTECTED] | | On Sat, Nov 28, 1998 at 09:03:39AM +0100, Ole J. Tetlie wrote: | It can also be 'int main(void)', which is equivalent to 'main()'. | | Hmmm. I was told that 'int func(void)' means it takes no parameters, | while 'int func()' means it could take any. That

Re: Hello World doesn't work

1998-11-28 Thread Kent West
On 28 Nov 1998, Ole J. Tetlie wrote: *-Havoc Pennington [EMAIL PROTECTED] | | On Fri, 27 Nov 1998, Kent West wrote: | |main() | | A long shot, but technically the above is illegal; you have to do: | int main(int argc, char* argv[]) It can also be 'int main(void)', which is