linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Chandan Chopra" <chandan.chopra@patni.com>
To: 'Suciu Flavius' <suciuflavius@tiscali.de>,
	linux-c-programming@vger.kernel.org
Cc: gcc-help@gcc.gnu.org
Subject: RE: Memory Allocation Problem
Date: Wed, 15 Sep 2004 12:08:08 +0530	[thread overview]
Message-ID: <000201c49aee$90a80180$c55ba8c0@patni.com> (raw)
In-Reply-To: <ci8ne4$j4k$1@sea.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2137 bytes --]


Or workaround could be you make declaration of 'a' global.

-----Original Message-----
From: linux-c-programming-owner@vger.kernel.org
[mailto:linux-c-programming-owner@vger.kernel.org]On Behalf Of Suciu
Flavius
Sent: Wednesday, September 15, 2004 9:06 PM
To: linux-c-programming@vger.kernel.org
Cc: gcc-help@gcc.gnu.org
Subject: Re: Memory Allocation Problem


1450 * 1450 * 8 = 16 MEGA!!!!!!!!!
So, you need a 16 mega of stack which I think is a little too much  ;)

The solution is to malloc() but check if you have 16 mega of ram ;)


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 }
>
>
> it gives segementation fault
>
> if i use malloc also it gives wrong result
>
> what to do?
>
> ankit
>
> ________________________________________________________________________
> Yahoo! Messenger - Communicate instantly..."Ping"
> your friends today! Download Messenger Now
> http://uk.messenger.yahoo.com/download/index.html
>

-
To unsubscribe from this list: send the line "unsubscribe
linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



http://www.patni.com
World-Wide Partnerships. World-Class Solutions.
_____________________________________________________________________

This e-mail message may contain proprietary, confidential or legally
privileged information for the sole use of the person or entity to
whom this message was originally addressed. Any review, e-transmission
dissemination or other use of or taking of any action in reliance upon
this information by persons or entities other than the intended
recipient is prohibited. If you have received this e-mail in error
kindly delete  this e-mail from your records. If it appears that this
mail has been forwarded to you without proper authority, please notify
us immediately at netadmin@patni.com and delete this mail. 
_____________________________________________________________________

  reply	other threads:[~2004-09-15  6:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
     [not found] <4147E06B.4030303@redpinesignals.com>
2004-09-15  6:34 ` Ankit Jain

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='000201c49aee$90a80180$c55ba8c0@patni.com' \
    --to=chandan.chopra@patni.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=linux-c-programming@vger.kernel.org \
    --cc=suciuflavius@tiscali.de \
    /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).