comp.lang.ada
 help / color / mirror / Atom feed
From: Keith Thompson <kst-u@mib.org>
Subject: Re: where exactly c++,c fail and Ada gets thru'
Date: Wed, 26 Apr 2006 19:33:40 GMT
Date: 2006-04-26T19:33:40+00:00	[thread overview]
Message-ID: <lnzmi8t9m3.fsf@nuthaus.mib.org> (raw)
In-Reply-To: 11708614.Atp6ZMqtRP@linux1.krischik.com

Martin Krischik <krischik@users.sourceforge.net> writes:
> Keith Thompson wrote:
>> In fact, it's not possible in C to pass an array directly as a
>> function parameter.
>
> Actually C99 can pass arrays. The declaration looks something like this:
>
> F (int A_Lenght, double A [A_Lenght])
>
> or
>
> G (double A [static 10])
>
> or even
>
> H (double A [*])
>
> But then: AFAIK: there is only one compiler which prides itself with
> actually implementing C99 arrays and one compiler which at least tries and
> and has the failures on it's bug list.

I'm fairly sure that still passes a pointer, not the actual array.
For example, the expression "sizeof(A)" inside the function will yield
the size of a pointer, not the size of the array.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center             <*>  <http://users.sdsc.edu/~kst>
We must do something.  This is something.  Therefore, we must do this.



  reply	other threads:[~2006-04-26 19:33 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-24  4:19 where exactly c++,c fail and Ada gets thru' Ananth the Boss
2006-04-24  5:05 ` jimmaureenrogers
2006-04-24  7:45   ` Ananth the Boss
2006-04-24 19:17   ` Martin Krischik
2006-04-24 20:23   ` Simon Wright
2006-04-24 22:34     ` Keith Thompson
2006-04-24 22:33   ` Keith Thompson
2006-04-25  5:23     ` Jeffrey R. Carter
2006-04-26 17:48     ` Martin Krischik
2006-04-26 19:33       ` Keith Thompson [this message]
2006-04-26 15:10   ` Maciej Sobczak
2006-04-26 17:32     ` Martin Krischik
2006-04-27 10:07       ` Maciej Sobczak
2006-04-27 21:19         ` Keith Thompson
2006-04-28  7:00         ` Martin Krischik
2006-04-28 12:27           ` Maciej Sobczak
2006-04-29  7:03             ` Martin Krischik
2006-04-29 14:08               ` REH
2006-05-01 10:20                 ` Xcriber51
2006-05-01 13:55                   ` REH
2006-05-02  6:43               ` Maciej Sobczak
2006-04-27 16:48       ` REH
2006-04-28  7:49         ` Martin Krischik
2006-04-28 11:17           ` REH
2006-04-29  6:47             ` Martin Krischik
2006-04-24  8:13 ` Rod Chapman
2006-04-25  1:57 ` Steve
replies disabled

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