comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <mcondic.auntie.spam@acm.org>
Subject: Re: Question on arrays
Date: Mon, 16 Sep 2002 08:08:09 -0400
Date: 2002-09-16T12:08:34+00:00	[thread overview]
Message-ID: <am4hk2$j1p$1@slb0.atl.mindspring.net> (raw)
In-Reply-To: d40d7104.0209160302.3a15485e@posting.google.com

That depends a lot on how A_Integer is declared. For one thing, when you are
de-referencing the array, you are talking about an object of its component
type, not an array, so the "(others =>...)" aggregate is probably
inappropriate. (A_Integer (2) probably references an object of type
"Integer" - which is not an array and to which you can't assign an
aggregate - but we'd have to see the declaration.) Secondly, *if* the array
is composed of objects of type Integer, then the aggregate references a
constant of type Unversal Real - which is a type mismatch. (2.0 is not the
same as 2 - at least in Ada context).

So you might get:

A_Integer (2) := 2 ;

to work Or possibly you might get:

A_Integer (2..3) := (others => 2);

to work (because now it is an array slice). Post a bit more code if this
doesn't explain it.

MDC

--
======================================================================
Marin David Condic
I work for: http://www.belcan.com/
My project is: http://www.jast.mil/

Send Replies To: m c o n d i c @ a c m . o r g

    "I'd trade it all for just a little more"
        --  Charles Montgomery Burns, [4F10]
======================================================================

prashna <vashwath@rediffmail.com> wrote in message
news:d40d7104.0209160302.3a15485e@posting.google.com...
> Hi all,
> Pls explain what is wrong in this statement?
>
> A_Integer(2) := (others => 2.0);
>
> where A_Integer is an array of integer, whose index is integer ranging
> form 1..10.
>
> I am using Tartan compiler on Aix machine and the error is
> "segmentation fault (core dumped)"
> Thanks in Advance.





  parent reply	other threads:[~2002-09-16 12:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-16 11:02 Question on arrays prashna
2002-09-16 12:03 ` Preben Randhol
2002-09-16 19:15   ` tmoran
2002-09-17  4:53     ` prashna
2002-09-16 12:08 ` Marin David Condic [this message]
2002-09-16 18:48 ` Jeffrey Carter
2002-09-17  9:14 ` David C. Hoos, Sr.
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox