Version française
Home     About     Download     Resources     Contact us    
Browse thread
Converting C arrays to Ocaml arrays
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jonathan Roewen <jonathan.roewen@g...>
Subject: Re: [Caml-list] Converting C arrays to Ocaml arrays
> I believe the array should already be null-terminated.

Well, I asked around, and some people say it's not.

So, instead, do: calloc(num+1), and then do: array[num] = NULL; and
null-termination problem will be gone.

And looking at caml_alloc_array, the most you'd prolly get is warning
about pointer vs int. caml_alloc_array doesn't appear to depend on it
being an actual pointer.

Jonathan