linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ankit Jain <ankitjain1580@yahoo.com>
To: gcc <gcc-help@gcc.gnu.org>,
	linux prg <linux-c-programming@vger.kernel.org>
Subject: Static memory allocation
Date: Fri, 24 Sep 2004 11:57:08 +0100 (BST)	[thread overview]
Message-ID: <20040924105708.5067.qmail@web52904.mail.yahoo.com> (raw)

hi

well i had tried to enquire about this problem

i was not able to find the solution. i know it workds
when i declare the array globally. i know if i use
malloc it will work and i am using the same in my
program

but this question is again in my mind that what could
be the reason that it dosent work here on my system
because last time when i asked this question on some
sytem it was able to run which they said that they
have less emory then that of my system

my system config.: redhat linux 9.0 +512 RAM
this is what my terminal displays

[ankit@Ankit fft]$ cat try2.c
#include <stdio.h>
int main()
{
double a[1450][1450];
 a[1450][0]=999.999;
 printf("%lf\n",a[1450][0]);
 return 0;
}
[ankit@Ankit fft]$ gcc try2.c
[ankit@Ankit fft]$ ./a.out
Segmentation fault
[ankit@Ankit fft]$

i just want to know that if there is some problem
related to stack how t oget rid of it

thanks

ANkit




________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html

             reply	other threads:[~2004-09-24 10:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-24 10:57 Ankit Jain [this message]
2004-09-24 12:51 ` Static memory allocation Patrick Percot
2004-09-25  9:14   ` Ankit Jain
2004-09-25 21:51     ` Patrick Percot
2004-09-25 10:03 ` Jon Masters
  -- strict thread matches above, loose matches on Subject: below --
2004-09-24 14:21 Huber, George K RDECOM CERDEC STCD SRI

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=20040924105708.5067.qmail@web52904.mail.yahoo.com \
    --to=ankitjain1580@yahoo.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=linux-c-programming@vger.kernel.org \
    /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).