From: "Ankit Jain" <ankitjain1580@yahoo.com>
To: Sriharsha Vedurmudi <sriharsha.v@redpinesignals.com>,
gcc <gcc-help@gcc.gnu.org>,
linux prg <linux-c-programming@vger.kernel.org>
Subject: Re: Memory Allocation Problem
Date: Wed, 15 Sep 2004 07:34:47 +0100 (BST) [thread overview]
Message-ID: <20040915063447.74013.qmail@web52904.mail.yahoo.com> (raw)
In-Reply-To: <4147E06B.4030303@redpinesignals.com>
--- Sriharsha Vedurmudi
<sriharsha.v@redpinesignals.com> wrote:
>
> Ankit Jain wrote:
>
> > 1 #include <stdio.h>
> > 2 int main()
> > 3 {
> > 4 double a[1450][1450];
> > 5
> > 6 a[1449][0] = 999;
> > 7 printf( "%lf\n", a[1449][0] );
> > 8 return 1;
> > 9 }
> >
well i am sorry its return 0 only
i have 128 mb RAM. it gives segmentation fault while
running
i tried it on 512 MB Ram also it gives segemntation
fault. around 400 MB of Ram was free when i tried to
run that program
thanks
ankit
> >
> >it gives segementation fault
> >
> >
> I tried, but it ran well. Except ofcourse, I changed
> "return 1" to
> "return 0" (you dont want to return an error from
> Main)
>
> >if i use malloc also it gives wrong result
> >
> >what to do?
> >
> >
> I guess your system is lacking the memory required
> to allocate 1450 *
> 1450 * 4 bytes on stack. Try making it static.
>
> -Harsha.
>
> >ankit
> >
>
>________________________________________________________________________
> >Yahoo! Messenger - Communicate instantly..."Ping"
> >your friends today! Download Messenger Now
> >http://uk.messenger.yahoo.com/download/index.html
> >
> >
>
________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html
next parent reply other threads:[~2004-09-15 6:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4147E06B.4030303@redpinesignals.com>
2004-09-15 6:34 ` Ankit Jain [this message]
2004-09-15 6:02 Memory Allocation Problem Ankit Jain
2004-09-15 12:01 ` Eljay Love-Jensen
2004-09-15 15:35 ` Suciu Flavius
2004-09-15 6:38 ` Chandan Chopra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040915063447.74013.qmail@web52904.mail.yahoo.com \
--to=ankitjain1580@yahoo.com \
--cc=gcc-help@gcc.gnu.org \
--cc=linux-c-programming@vger.kernel.org \
--cc=sriharsha.v@redpinesignals.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).