Re: where exactly c++,c fail and Ada gets thru'
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Wed, 26 Apr 2006 19:33:40 GMT
Martin Krischik <krischik@xxxxxxxxxxxxxxxxxxxxx> 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@xxxxxxx <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.
.
- References:
- where exactly c++,c fail and Ada gets thru'
- From: Ananth the Boss
- Re: where exactly c++,c fail and Ada gets thru'
- From: jimmaureenrogers@xxxxxxxxxxxxxxxx
- Re: where exactly c++,c fail and Ada gets thru'
- From: Keith Thompson
- Re: where exactly c++,c fail and Ada gets thru'
- From: Martin Krischik
- where exactly c++,c fail and Ada gets thru'
- Prev by Date: Re: where exactly c++,c fail and Ada gets thru'
- Next by Date: Re: procedural vs object oriented
- Previous by thread: Re: where exactly c++,c fail and Ada gets thru'
- Next by thread: Re: where exactly c++,c fail and Ada gets thru'
- Index(es):
Relevant Pages
|