Re: where exactly c++,c fail and Ada gets thru'



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.

Martin
--
mailto://krischik@xxxxxxxxxxxxxxxxxxxxx
Ada programming at: http://ada.krischik.com
.



Relevant Pages

  • Re: Origin of size_t? Curious.
    ... >>> If the size cannot be taken, then how can sizeof do ... >> contains a declaration of type that is too large, ... > My compiler accepts the oversized declaration, ... Several such arrays ...
    (comp.lang.c)
  • Re: Porting apps
    ... >> shut the compiler up. ... As I said, the usual suspects. ... If you don't have a C99 ... and then you only have to fix one declaration per port in the ...
    (comp.programming)
  • Re: I request inclusion of reiser4 in the mainline kernel
    ... C99 requires a declaration (not necessarily with a ... I'm not sure whether this is new in C99 ... A compiler might optimize away the reference to the ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: Aaahhrg! Trouble passing an array of structs to a function!
    ... I moved the function declaration up and it worked. ... Because I will eventually have many types of arrays of structures but want ... Declare the function before calling it. ... A C++ compiler would have produced an error, ...
    (microsoft.public.vc.language)
  • Re: "Homemade" C99 prototype?
    ... but also a C99 compiler, because a C90 compiler will choke ... on the `restrict' keyword. ... if you don't IME the presence of the apparently-correct declaration ...
    (comp.lang.c)