Re: core dump
Tom Hull <[email protected]> Wed, 04 Jun 2003 09:51:17 -0500
| Newsgroups | gmane.org.user-groups.aclug.linux-help |
|---|---|
| Message-ID | <[email protected]> |
Sudharsha Wijesinghe wrote:
> I wrote the following code
> int void main()
> {
> int buff[4096],i;
> for(i=0;i<8000;i++)
> buff[i]=i;
> return 0;
> }
> and compliled it with gcc
> executable file created.
> when I run it
> #./a.out
> I would get a segment fault
> it does not create a core dump.
> Does any one know why it is?
> Thanks in advance
> Sudharsha.
Of course. Is this a test, or just a joke?
The code won't compile because you say: int void main().
Get rid of the void. You're returning a value from the
function so the function isn't void -- it returns a
value.
Also change 4096 to 8000, or 8000 to 4096. Then figure
out why that works and what you had didn't.
--
/*
* Tom Hull * thull2(cox.net) * http://www.tomhull.com/
*/
-- This is the [email protected] list. To unsubscribe,
visit http://www.complete.org/cgi-bin/listargate-aclug.cgi