>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 thi
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)', w
*-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
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.
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.
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
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
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.
> th
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 #include
man 3 printf will show you this.
> main(
*-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 f
> main()
> {
> printf("Howdy, World!\n");
> }
I would sugest putting the following line before main()
#include
Alex Y.
--
_
_( )_
( (o___ +---+
| _ 7 |Alexander Yukhimets|
\(")
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
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
13 matches
Mail list logo